ContributionsMost RecentMost LikesSolutionsRe: IOL working (JSON) would like to save to field in formThank you both very much. I will work with the code to see if I can get it both ways, just in case the IOL does go away. Can't thank you both enough! ------------------------------ Randy Gibbons ------------------------------ RE: TablasBuenos - depende donde esta. Se puede usarIf( [field] < 0, "red") o utilizarIf( [field] < 0, "<span style='background-color: #EA3C53'>" & ToText([field]) & "</span>", [field]) en un field de formula. ------------------------------ Randy Gibbons ------------------------------ Re: IOL working (JSON) would like to save to field in formThanks Sam, worked like a champ! Just need to be in Edit mode for it to populate, but no issues. Added it after the bottom console.log lines. What other solution would you suggest based on this? I know there are pipelines, but our org has them disabled at the realm level. Randy ------------------------------ Randy Randy ------------------------------ IOL working (JSON) would like to save to field in formI was able to use IOL and read in the data from the JSON API using the model.js (below), pass a variable (satellite) and see the data in the console after pressing the button (props to Diebolt! and his pasties). This is using just a basic ISS satellite tracking API. The Key field for the form is the satillite number [satillite], which in this case is the ISS, which is the variable I'm passing. Page: module.js (function(){ var dbid = "application dbid"; var dbidTable = "table dbid"; var apptoken = "app token"; $.ajaxSetup({data: {apptoken: apptoken}}); $("a.QBU_Button").on("click", function(event) { console.log("onclick in module.js"); var satellite = this.dataset.satellite; console.log("Satellite#:", satellite); var url = "https://api.wheretheiss.at/v1/satellites/"; var options = { id: satellite, format: "JSON" } $.get(url, options).then(function(resp) { console.log("Latitude:", resp.latitude); console.log("Longitude:", resp.longitude); console.log(JSON.stringify(resp, null, " ")); }); }); })(); Button: (rich text formula) [iol] & "module.js" & [/iol] & "<a class='QBU_Button Vibrant Success' " & " data-satellite='" & [satellite] & "'" & ">Button</a>" What I can't figure out is how to take the resp.latitude value and use the API_EditRecord to insert the latitude value into the current record into Field 7 Latitude (text field). Any thoughts on this? Thanks! ------------------------------ Randy ------------------------------ SolvedRe: Button to create child record error Missing ""rid"" parameter due to saveThanks for the reply. They are creating a work ticket, for example an email that requires research. They start the ticket, but get called into another direction and need to put the ticket on hold, stopping the resolve time on the ticket. They fill out the required fields, and click stop, which should save the record, add a child record to track the stop time, then change the status of the ticket to On Hold. Then when they start working the ticket again, the click the button, which updates the Child record to start the clock and changes the ticket status on the parent to In Progress. All of that works correctly only if the parent has been saved first.Button to create child record error Missing ""rid"" parameter due to saveI have a button that creates a child record from the parent record. It works perfectly only after the parent record has been saved the first time, thus creating the Record ID#. I have the 'Save parent record automatically when a child record is created.' box checked. When I hit the button on a newly created parent record, it will save the parent record, but produces this error message when trying to run through the button code to create a child record: <qdbapi> <action>API_EditRecord</action> <errcode>30</errcode> <errtext>No such record</errtext> <errdetail>Missing "rid" parameter.</errdetail> </qdbapi> So to summarize, the button works correctly only after the parent has been saved and retrieved. I'm looking for the button to save the record, create a child, and return back to the parent in edit mode, updating some fields (status) and to continue working in the record.Re: Sum minutes between child recordsThank you, that worked perfectly! I created the 'maximum' summary on Record ID# to get the last record. Here is the final code, I think it might help others in trying to create a dynamic button (the xxxxxxx is your Database ID): //Change Start Parent var text URLSTARTTWO = URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_12="&URLEncode("O-In-Progress") & "&_fid_17="&URLEncode("O-In-Progress") & "&_fid_14="&URLEncode(Now()); //& "&rdr=" & URLEncode(URLRoot() & "db/xxxxxxxxxx?a=td"); // Create Start Child Record var text URLSTARTONE= URLRoot() & "db/" & [_DBID_TICKET_TIME_HISTORY] & "?act=API_EditRecord&rid=" & [Maximum Record ID#] & "&_fid_8=" & URLEncode ([Record ID#]) & "&_fid_6="&URLEncode("Start") & "&_fid_10="&URLEncode(Now()); // Edit Stop Child Record var text URLSTOPONE= URLRoot() & "db/" & [_DBID_TICKET_TIME_HISTORY] & "?act=API_AddRecord&_fid_8=" & URLEncode ([Record ID#]) & "&_fid_6="&URLEncode("Stop") & "&_fid_7="&URLEncode(Now()); //Change Stop Parent var text URLSTOPTWO = URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_12="&URLEncode("O-Stalled") & "&_fid_17="&URLEncode("O-Stalled") & "&_fid_14="&URLEncode(Now()); //& "&rdr=" & URLEncode(URLRoot() & "db/xxxxxxxxx?a=td"); var text URLTHREE = //URLRoot() & "db/" & "db/" & [_DBID_TICKETS] //& "?a=dr&rid=" & ToText([Record ID#]); URLRoot() & "db/" & [_DBID_TICKETS] & "?a=dr&rid=" & ToText([Record ID#]); If( [Status]="O-Stalled", $URLSTARTONE &"&rdr="&URLEncode($URLSTARTTWO) &URLEncode("&rdr="&URLEncode($URLTHREE)) , $URLSTOPONE &"&rdr="&URLEncode($URLSTOPTWO) &URLEncode("&rdr="&URLEncode($URLTHREE)) )Re: Sum minutes between child recordsI can't thank you all enough for your direction. But how would you edit this so that it doesn't create a new record for the 'stop', but just edits it? I think the 'start' should create a new record. I can't seem to figure out what the latest record to use API_EditRecord on for the edit of the new stop field. Here is my code that has an if statement that dynamically changes the URL: // Create Start Child Record var text URLSTARTONE= URLRoot() & "db/" & [_DBID_TICKET_TIME_HISTORY] & "?act=API_AddRecord&_fid_8=" & URLEncode ([Record ID#]) & "&_fid_6="&URLEncode("Start") & "&_fid_7="&URLEncode(Now()); //Change Start Parent var text URLSTARTTWO = URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_12="&URLEncode("O-In-Progress") & "&_fid_17="&URLEncode("O-In-Progress") & "&_fid_14="&URLEncode(Now()); //& "&rdr=" & URLEncode(URLRoot() & "db/xxxxxxxxxxx?a=td"); // Create Stop Child Record var text URLSTOPONE= URLRoot() & "db/" & [_DBID_TICKET_TIME_HISTORY] & "?act=API_AddRecord&_fid_8=" & URLEncode ([Record ID#]) & "&_fid_6="&URLEncode("Stop") & "&_fid_7="&URLEncode(Now()); //Change Stop Parent var text URLSTOPTWO = URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_12="&URLEncode("O-Stalled") & "&_fid_17="&URLEncode("O-Stalled") & "&_fid_14="&URLEncode(Now()); //& "&rdr=" & URLEncode(URLRoot() & "db/xxxxxxxxxxx?a=td"); var text URLTHREE = //URLRoot() & "db/" & "db/" & [_DBID_TICKETS] //& "?a=dr&rid=" & ToText([Record ID#]); URLRoot() & "db/" & [_DBID_TICKETS] & "?a=dr&rid=" & ToText([Record ID#]); If( [Status]="O-Stalled", $URLSTARTONE &"&rdr="&URLEncode($URLSTARTTWO) &URLEncode("&rdr="&URLEncode($URLTHREE)) , $URLSTOPONE &"&rdr="&URLEncode($URLSTOPTWO) &URLEncode("&rdr="&URLEncode($URLTHREE)) )Re: Sum minutes between child recordsThat makes more sense. I need to modify my code to edit the existing record, rather than create a new one. My child table looks like this: Record ID: 17 Status: Stop Status Change: 9/22/2017 11:04AM Ticket ID: TID0031 Record ID: 18 Status: Start Status Change: 9/22/2017 11:06AM Ticket ID: TID0031 Record ID: 19 Status: Stop Status Change: 9/22/2017 11:15AM Ticket ID: TID0031 Record ID: 22 Status: Start Status Change: 9/22/2017 11:16AM Ticket ID: TID0031Re: Sum minutes between child recordsThanks for the suggestion, but not sure that will work. I'm looking for is a sum count of minutes that can be brought back over to the parent account. For example, the hit stop and start that equals 10 minutes, so the actual ticket work time needs to be deducted 10 minutes.