AnsweredAssumed Answered

Looping off on trigger or tricking script

Question asked by ChrisJohnston on Dec 30, 2013
Latest reply on Dec 30, 2013 by philmodjunk

Title

Looping off on trigger or tricking script

Post

Per this document here I have been able to better understand why there are considerations for using a loop in a script that runs when the page loads. Does anybody have examples of this done properly to not cause the repeating loop problem? I have started testing what I figured is a way to sort of trick it in to not knowing its recursive self. What I am working on is a way to make the script let another layout do the work with the loop and then come back to the layout telling it not to run any scripts. The not to run any scripts part is what I am trying to figure out. Also I don't understand what is being referred to as the object. I know what an object is but I can’t see it here. I don't know if someone can easily see what the object in my script is but I put a sample of it anyway. Thanks


Set Field [INFORMATION::record_listing; ""]
Set Variable [$infid; Value:INFORMATION::_kp_information_id]
Set Variable [$infname; Value:INFORMATION::information_name]
Go to Related Record [Show only related records; From table: “INFORMATION_Topic”; Using layout: ]
Set Variable [$reclist; Value:If (  Get(FoundCount) = 0;  $infid;  $infid & "¶" & GetFoundSet("_kp_information_id")  )]
Set Variable [$reclistnm; Value:If (  Get(FoundCount) = 0;  $infname;  $infname & "¶" & GetFoundSet("information_name")  )]
Loop
  Go to Related Record [Show only related records; Match found set; From table: “INFORMATION_Topic”; Using layout: ]
  Exit Loop If [Get(FoundCount) = 0]
  Set Variable [$reclist; Value:$reclist & GetFoundSet("_kp_information_id")]
  Set Variable [$reclistnm; Value:$reclistnm & GetFoundSet("information_name")]
End Loop
Enter Find Mode []
Set Field [INFORMATION::_kp_information_id; $infid]
Perform Find []
Show All Records
Set Field [INFORMATION::record_listing; $reclist]
Set Field [INFORMATION::record_listing_name; $reclistnm]

Outcomes