Hi all! I've got a bunch of tax vendors on the wro...
# suitescript
k
Hi all! I've got a bunch of tax vendors on the wrong sub, which cannot be moved to the correct sub. I want to create copies of these on the correct subs. My question is, can you change field values in a record.copy before saving it, or am I going to have to do a record.create and read all the values from the old one and write them to the new one?
m
Yes. After calling
record.copy()
, you can update the newly created record, then call
record.save()
when you're ready.
k
Ok, I wasn't sure if the record.copy would save the record instantly or if it would let you change it first. Thank you!
A bigger issue is that Vendor ID is a unique key and is disabled, so I'm not sure how I can edit the old one's vendor ID to create the new one with the same name...
Nevermind, just disabled in the UI. Map/Reduce scripts have no problem with it.