before i start going down a rabbit hole i wanted t...
# suitescript
p
before i start going down a rabbit hole i wanted to check with the group here if what I want to do is possible: i would like to have a button create multiple custom records based on a search. Basically, in my salesorder I have a subtab with a custom record. When the salesorder is copied using the make a copy button the sublist is not. My goal is to have the user - on the new salesorder - click on the button so that it "duplicates" the data in the sublist. Plan is to have a search conducted on the sublist custom record using the original salesorder id and then using what is found (usually multiple custom records) and copying those records and assigning the new salesorder id to the parent field on the custom record.
s
Would this just make more sense to put a UE on the Sales Order and only trigger when the context is COPY rather than making someone click a button?
Well, I actually don't know that you would get the original salesorderid in that instance
m
Looks like you can grab that ID from this answer from Eric https://netsuitehub.com/forums/topic/set-a-copied-from-value-when-copying-a-transaction/
If you're able to get that, your logic seems sound and I don't see why that wouldn't work using Sandii's approach as long as you can pull that id.
b
Expect to do this after the copy is saved
A lot of suitescript wont work on records that dont exist yet
p
thanks all. will give this a shot.