ContributionsMost RecentMost LikesSolutionsRe: Button on Dashboard (HomePage) to invoke Await-Async JS codeHi Dan, Reg. button: Ok, if you recommend table homepage button is not required then I will stick to the button on report then. Thank you. Reg. issue with my code: I will start a new thread. I will grant you access to my application to look at the issue I'm facing. Thank you. ThanksRe: Button on Dashboard (HomePage) to invoke Await-Async JS codeHi Dan, Happy New Year to you! Just checking in to see if you had the opportunity to look into this issue. Regards SaudaRe: Button on Dashboard (HomePage) to invoke Await-Async JS codeHi Dan, 1) Reg. use of button on homepage - This is the post where we extensively discussed the issue with IOL techniques and it contains your suggestion (last but second post of yours) to trigger JS code using button on home page. In the first technique: saving the report does not save the "concatenated text" in the downloaded file, and then when applying filters on the report, the concatenated text field blanked out and the value was not recalculated So, you suggested the second technique of using await-async method. 2) I just edited your code to point to my tables and fields. Do you want me to grant you access to my application? Thanks, SaudaButton on Dashboard (HomePage) to invoke Await-Async JS codeHi Dan, As advised, starting a new post on "how to configure a button on the home page to concatenate text from all the child records using await/async technique." Can you please share regarding this 1) Background on using Await/Sync technique setup 1) The iol field is placed on the parent record form to invoke the JS code. 2) Theawait/async loops through the report on the child table. Child report contains two columns: Text Field (that needs to be concatenated), Record ID of the parent record. The report is sorted and grouped based on the record id of the parent. 3) The code concatenates text from all the child records of a parent record, edits the parent record to set the concatenated text to a field. So, instead of placing the iol field on the parent record and seeing the "reload behavior", it is probably best to have it triggered via button on the home page. 2) Performance: What do you think is causing the performance to degrade? - My child report has 1200+ records that belong to almost 1000+ parent records. Code is taking very long time to calculate the concatenated text. The code is not fast and the speed reduces gradually. It edited 50+ parent records in 2 hours! Thank you, and as your help and guidance is highly appreciated!Re: Using image onload field in a report leads to the repeated execution of the javascript and thereby leads to incorrect outputHi Dan, Good Morning. Thank you for all the responses! 1) Please be assured that I'm not executing my test code against your demo tables. I just added two child records to test the functionality. All the changes/r&d is in my copy app. Should I send my code to your email address? 2) I think I'm not asking the question correctly. Let me investigate more on this. (I need the v0 parameter value to change dynamically to single parent record id or list of parent record ids in the parent table report. I currently hard-coded it to one of the parent table recordnumbers.) 3) Very clear explanation, thank you! Let me investigate this on my own and I will come back to you if I have questions. Thanks, SaudaRe: Using image onload field in a report leads to the repeated execution of the javascript and thereby leads to incorrect outputHi Dan, Thank you for the inputs. I got the new code working too and have few questions and need your guidance. 1) "My code queried all child records using {qid: 6} for simplicity of the demo." Oh, my mistake! It was my oversight to read "qid" as "query". My report in child table has "ask user" field to specify the parent record id. I hard coded the parent record id to test the code. $.get(dbidActors, { act: "API_DoQuery", qid:"1000084", nv:"1", v0:"7524" }) >>>> The concatenated text is appearing in the parent record. However, the code is looping and the execution does not break! Meaning, in the every iteration, the output is calculated twice for each delimiter. And This looping behavior is seen in both the "view mode" of the record#7524 and on the parent table report that contains #7524. Why is the execution not stopping when the concatenated text is displayed for #7524 the first time? >>>>I stopped the execution after 12 iterations, please see the log file. For 12 iterations, we have output text calculated 24 times? Please see the txt file the log output Here is the screenshot of the output displayed in parent record and parent table report. 2) My parent and child tables have 10,000+ records each so I think I will have to execute the code for specific parent record ids ONLY and I'm not sure how to pass the parent record id or ids dynamically in the JS doquery code that uses qid(that is, a report). Can you give me some input on this? Should I use the following code to extract the list of parent record identifiers (rids) and loop (using "for" or "._chain") through it using v0:rids in DoQuery? var rids = $("div.QBU_Childs").map(function() { return this.dataset.rid; }).get(); 3) "It shows up when I run the script anew" - Can you please clarify what you mean by "run the script anew"? Movies table home page only has the concatenated text field (_fid_12). I don't see the formula text field that invokes the script. How did you run the script for all the records in parent table for the home page to reflect the new concatenated text? Thanks SaudaRe: Using image onload field in a report leads to the repeated execution of the javascript and thereby leads to incorrect outputHi Dan, Thank you for the direction. 1) I looked at the example and it seems that the await/async technique resolve the issues I mentioned. - I looked at the new code and could not evaluate the piece of code that would query for the specific parent record or set of records in a report? (I was trying to locate something on the lines of ridstoquery() in the original code.) - I tried to adapt the code and using the word "await" before Promise.resolve does not execute the JS code. Are there any prerequisites (browser related maybe?) to be able to use "await"? (I'm using Google Chrome) 2) I added a new Actor (to the Movie record Dr.No) in your example database and the concatenated text did not get updated. - Did I add the Actor record incorrectly? 3) Would it be possible for you to add the brief comments to the different portions of the Pasties code to explain action/input/result for that specific section? Thanks, SaudaRe: Using image onload field in a report leads to the repeated execution of the javascript and thereby leads to incorrect outputHi Dan, So, I was able to resolve the issue. The report and the individual records in the parent table display the concatenated text correctly. I have few other issues/questions though: 1) On saving the report, instead of the concatenated text, the report displays the formula code. How can we get the report to save the "concatenated text"? 2) The iol code does not execute when dynamic filters are applied to the report. Any guidance/input is highly appreciated! Awaiting your response. Thanks, SaudaRe: Using image onload field in a report leads to the repeated execution of the javascript and thereby leads to incorrect outputHi Dan! Is the above information sufficient for you to debug the code?Re: Using image onload field in a report leads to the repeated execution of the javascript and thereby leads to incorrect outputHiDan! Thank you for the response. Here are the details. 1) My App variables and Formula Field in parent table: a) iol => <img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename= b) /iol => &rand='+new Date().getTime())};"> c) Childs2: [iol] & "module.js" & [/iol] & "<div class=QBU_Childs data-rid=" & & "></div>" 2) HTML source of the tag that is getting rendered in the parent report <tr> <td class='FirstColumn'><img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=module.js&rand='+new Date().getTime())};"><div class=QBU_Childs data-rid=444></div></td> <td align=right class='NoWrap'>444</td> </tr> <tr> <td class='FirstColumn'><img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=module.js&rand='+new Date().getTime())};"><div class=QBU_Childs data-rid=445></div></td> <td align=right class='NoWrap'>445</td> </tr> 3) Data in my parent/child tables: Parent Record #444 has 3 children - child1 value: ghi, child2 value: def, child3 value: abc) Parent Record #445 has 3 children - child1 value: 123, child2 value: 456, child3 value: 789) Expected data output is to have parent record and reports in the parent table to display: 444 - ghi, def,abc 445 - 123, 456, 789 4)module.jsis same as inhttps://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=464&_ga=2.235786049.17404487.... Here are the details of the code changes that I tried: a) I changed dbid, dbidParents,dbidChilds, apptoken, relatedParentFid, relatedParentLabel, clist - clist is fetching two fields: 1) child unique record id # and 2) data-value that I want to concatenate and display in parent table b) I modified the following two lines in js file. Please see the screenshot for the output related to Code2 and Code3 >> Code1: as it is in Pasties example var markup = Mustache.render(template, item); $("div." + qbuClass + "[data-rid=" + rid + "]").html(markup); Output: no result within in the parent record and parent table report >> Code2: using console.log, I saw that rid contained the child record value that I need to display in parent record var markup = Mustache.render(template, {comment: rid}); $("div." + qbuClass).html(markup); Output: - always lists the last child value in the individual parent record - parent table report has the last value in the loop for both the records (I think this is because I eliminated unique identifier for the div?) >> Code3: I changed .html to .append in code2 var markup = Mustache.render(template, {comment: rid}); $("div." + qbuClass).append(markup); Output: - lists the concatenated child values within an individual record - but I think due to .append(), all the records in the report have the concatenated list of child values for "all" records (I think this is because I eliminated unique identifier for the div?) 5) Dan, should we change something in this function as well? function ridsToQuery(rids, fid) { fid = fid || "3"; return "{" + fid + ".EX." + rids.join("}OR{" + fid + ".EX.") + "}"; }