Does anyone know if NetSuite natively provides a l...
# suitescript
d
Does anyone know if NetSuite natively provides a link between lines when you transform? I'm transforming Vendor Bills to Vendor Credits and I don't see any linking IDs in the line data on the resulting Vendor Credit. There was orderdoc and orderline from PO to the Vendor Bill. Would I have to add a UUID to the Vendor Bill lines and pick that up on the transformed credit?
b
do a search
use the applying transaction or applied to transaction join to get the related line
d
You are right although wouldn't that mean I'd need to save the Bill Credit first?
b
yes
d
thanks battk 🙂
b
there might be other fields used to link the two
check on the transformed record before you save it
d
all good, I did save one earlier and xml viewed it to hunt for IDs, I don't think there'll be anything in the nlobjRecord scope object that wouldn't be in the data committed to the db, and if there were I'm not sure I trust it. I've got a UUID generation function so I'm just going with that for now. Appreciate the help very much :)
b
some fields are used by the record model but not returned by it
d
undocumented fields aren't they?
b
netsuite obviously stores the link between the 2 since the applying transaction join works, but it doesnt always return the same data between searches and records
d
yes, that's right
the trouble is I can't save the record before editing the lines. I didn't know that data normally reserved for return in a search was available in the nlobjRecord returned from record.transform() and I don't know if it's documented if it is. I'm interested to learn about it but my company doesn't allow me a lot of time to get the work done.
I'd already written a UUIDv4 generator so I'm just going to use that with a new transaction column
next time I come across it I'll dump out the nlobjRecord first and investigate that. You've taught me that much.