May 23, 201213 yr Hello again, I would like to create a script that allows me to clear just one field that are in the recordsdisplayed through a portal. Is this possible? The script I have only clears the field of the active record in the portal, but not the rest of the records that are displayed. My scenario: I'm looking at Record/Job #123. I have a portal displaying multiple records of all material that was ordered on Job #123. On each material record there is one field called "amount to bill." I would like the option to clear the contents of this one field when I press a button from my Job table. Please let me know if further clarification is needed and thank you so much ahead of time for the help!
May 23, 201213 yr Hi use replace field contents script - make sure this is the only found record though or you will delete more than you had hoped.
May 23, 201213 yr Two methods: 1) Go to the related records, then loop through them and set the field, then return to the original layout (or do it all in a separate window) 2) Create a script that goes to the first portal record and sets the field, then using a loop goes to the next portal row and sets that, and exits after the last portal row. This method has the advantage that the changes to the portal records are not committed until the master record is committed, so it is possible to roll-back all the changes to the related records if there is an error editing one of them.
May 23, 201213 yr Author I set up method #2 and it works perfectly. I couldn't for the life of me figure it out last night, so thank you so much once again Vaughan! You're a guru!
May 25, 201213 yr Author I seem to have run into a little roadblock. I have another table within the same file that shows the same portal, but the script doesn't work in this table. I checked my relationships and think everything seems to be in order, but clearly I'm missing something. Any ideas? Thanks again...
May 25, 201213 yr It may be the same relationship, but if it's another portal, then it's a different object (and also the fully qualified field names will be different), so the script won't work. If you use Vaughan's method no 1 from above, you could write one script which clears the field in the child table in a loop. Then from whatever context you're on, simply go to the proper related records in a new window, call the script, then close the window.
May 25, 201213 yr Author Haha..well, I just did a cheeky workaround..I made a new script to go to the layout where the original script works, perform the script, and return to the original layout. :laugh2:
June 13, 201213 yr Two methods: 1) Go to the related records, then loop through them and set the field, then return to the original layout (or do it all in a separate window) 2) Create a script that goes to the first portal record and sets the field, then using a loop goes to the next portal row and sets that, and exits after the last portal row. This method has the advantage that the changes to the portal records are not committed until the master record is committed, so it is possible to roll-back all the changes to the related records if there is an error editing one of them. I'm interested in solution #2 since I have to face a similar problem as OP. What's the best way to make a script go to a portal? "Go to object" using object name? Or directly "go to portal row" (first)? Thanks
Create an account or sign in to comment