Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script to clear one field in records displayed through a portal

Featured Replies

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!

Hi

use replace field contents script - make sure this is the only found record though or you will delete more than you had hoped.

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.

  • 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!

  • 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...

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.

  • 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:

  • 3 weeks later...

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.