Anyone know of a resource that lists the order in ...
# suitescript
m
Anyone know of a resource that lists the order in which I need to create a
dynamic
record? Specifically Sales Order & Purchase Order. Only info I can find in SuiteAnswers seems to boil down to Order Matters. Thanks!
i
It's the same as the UI order. Just open the transaction and manually set values to see what is being sourced, overwritten or re populated.
m
thanks @igorp! So to make sure I'm following, does that mean Items go last?
also, is there a cleaner way of assigning values (i.e. a loop) or should I just have a list of
rec.setValue('firstfield', 'firstvalue')
i
A couple of suggestions: 1. If applicable, use nlapiTransformRecord to create transaction. 2. Items indeed go last. 3. Regarding values assigning, it really depends on the scenario and the business logic. For example, If you creating this record via integration(Restlet) , you can't just iterate through the JSON and assigns values, since JSON is not always parsed in the same order, so in this case, you will just have to assign values one by one(or, not to use dynamic mode).
m
right, so I currently use standard mode (and looping through a JSON) but it's causing a ton of issues that i'm hoping dynamic will fix. I'll look into
transform
, thanks for the suggestion!