I think first would be best to describe why you need to do this?
If I understand, you have a found set of records, with related records. You want to grab this found set of records, and all their related records, and move them to another table, and put them in a portal.
You just want a found set of records to show up on a portal in another table.
If it's this second one, I would think the portal you want the records to show up on could just be another relationship, of duplicated TOs, filtered by a foreign key you put on those records. IOW, the filtered portal or relationship will only show records that are related to the records you marked. I know I didn't explain what's in my head correctly, but let me make sure I'm on the right track to identifying the problem
Although, if what you have works properly for one record, then you could just wrap your script in a loop that will go to the next record and repeat.
Thank you, the idea is to add an alternative (and quicker) way for a user to make a price list.
At the moment the user has to go the PRICE LIST and click a popover which displays a portal to artwork and select which artwork to add one by one. It would be great for a user to flag what they want to add while in artwork and then click a button to add the lot to a price list in one go. I have set up invoicing in this way and that works fine - however this is much easier as artworks can only be on one invoice at a time. So there is a direct relationship between invoices and artwork. Attached is my invoice script which works fine. I want to apply this logic to price lists.
I wondered about the loop idea, how do I implement this I've not used it before.
Hi Steve, I now have the first two artworks in a foundset being added with the below script.. Do you know how to make them all get added?
First, make a duplicate copy of your script.
If I understand what you are doing, your loop is in the wrong spot.
Lets say the parent record has 5 records with multiple child records
Generally you should, starting from your found set of records.
Go to record/request/page [first]
Set your variables// from the parent record you are on
Go to the layout you want (or the related record) in a new window.
Do your set fields
Go to Record/Request/Page [next, exit after last]
Close window // your done with the child records, close the window
Go to Record/Request/Page [next, exit after last] // this is for the parent records
This is the very basic concept, but you have to watch it in the debugger to make sure it is performing as you want it.