Forum Discussion
SaudaFurkhana
9 years agoQrew Cadet
Hi 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
Sauda
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
Sauda