June 20, 200223 yr I have a script that uses the set field command, that when executed, changes a field (formatted as a pop-up) to "Yes." The problem is that the field is in a portal. The script works, but it will only change the first line of the portal. If the portal has entries in more than one line, it does not change the pop-up field to "Yes" in any other lines (related records) except the first. Is there a way to get the script "set field" to change all the fields in the portal, no matter how many lines (records) there are? LR
June 20, 200223 yr Change the script from set field[related field, "yes"] to Replace [related field, "yes"] Dj
July 2, 200223 yr Author The above suggestion works...but to a point. It not only changes the field in the record I am in, but it changes it in all the portals in all the records, not just the related one. Any suggestions?
July 3, 200223 yr But it's exactally what you have asked for Is there a way to get the script "set field" to change all the fields in the portal, no matter how many lines (records) there are? Dj
July 3, 200223 yr Author Sorry...sometimes it is hard trying to explain the specifics of a problem. I probably did not do a good job of stating it. My main database has a portal that shows related records. One of the fields contained in the portal is a pop-up. I want a script that will change the field to "yes." The script I have been using only changes the field from the first line in the portal. If there are more than one record being displayed in the portal, I want the script to change the field from all of them to "yes." The script needs to run on the current diplayed record, or in other words, change all the fields called "change me" in the related records being displayed in the portal from "no" to "yes." LR
July 5, 200223 yr You can use a simple go to portal row - next step to loop through the portal rows. Or use Go to related record - only show related records. then perform script (external) the external script is then a replace script in the related file that sets the field you want to Yes. (Or if you dont want the Replace dialogue to appear, use a looping script to set the field.) Also remember to include at least one more script step in your first script, or Filemaker will end in the related file. A simple goto field, without seting a field works well. Also freeze the window at the start of the first script, this will speed things up and also stop unsightly screen jumps. Rigsby
Create an account or sign in to comment