Ultradistance2005 Posted April 19, 2014 Posted April 19, 2014 I am trying to create a script that will go to the next row of a portal (thus creating a new, related record) and enter data there. For some reason, no matter what portal commands I use, I cannot get past the last row that already has data in it. Any advice on how to create this new record in the portal through a script would be appreciated. Thank you.
eos Posted April 19, 2014 Posted April 19, 2014 For some reason, no matter what portal commands I use, I cannot get past the last row that already has data in it. In the relationship the portal is based on, the option to "allow creation of related records via this relationship" must be checked for the portal TO; otherwise you'll not be able to create a related record in the portal, manually or per script, because you'll only see existing records. Activate that option, and give the portal an object name in the Inspector palette. Once these prerequisites are in place, you can simply script … Go to Object [ objectNameOfPortal ] Go to Portal Row [last ] Set Field [ portalTO::someField ; "someValue" ] … because the last portal row in a portal whose relationship allows creation is the “spare row” used to create new related records.
Ultradistance2005 Posted April 19, 2014 Author Posted April 19, 2014 Thank you for the ideas. I had the relationship set up correctly, but it was still stopping at the first row and changing the data there. I just set up an "If empty" on one of the fields in the row, and instructed it to perform the script, but if not go to the last row, and it seems to be working. Thank you.
HALBURN Posted April 20, 2014 Posted April 20, 2014 Here is a technique that you might like better than the "go to last portal row" method. (see the attached sample). I started using this technique for all of my data entry into portals and my users seem to prefer it over the "go to last portal row" method. Especially if there are a lot of line items in the portal, as this method eliminates the need for scrolling. new_portal_record_with_portal_filtering.zip
Recommended Posts
This topic is 4206 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now