Anybody got a script kicking around that sets fields on a Sales Order by looking up predefined values in a custom record?
Anyone willing to share it with sufficient info for a "non-scripter" (but wanna be) to implement?
As incentive, there's a free pair of golf shoes in it for the best (judge's opinion is final) entry.
Back story is I want to assign default values on a Sales Order based on the Shipping Method (Shipping Item) chosen.
Thought I could add custom fields to the Shipping Item but apparently that's not supported by Netsuite.
Was told script was the way to go.
My "relational database" / SQL analogy would be to create a table (let's call it ShipViaPlus) with Shipping Methods as it's key.
Examples of Fields in that custom table would be Freight Code (value = "PP", "TP", "CC", etc.) and SCAC Code (value = "UPSN", "FDXG", etc).
I would have matching custom body fields on my Sales Order table.
When creating (or editing) a Sales Order and setting {shipmethod} the script would trigger and:
Look up the Sales Order {shipmethod} in the custom table ShipViaPlus (essentially Join the tables by Shipping Method).
Set Sales Order {freightcode} = ShipViaPlus {freightcode}
Set Sales Order {SCAC} = ShipViaPlus {SCAC}, etc.
In terms of error trapping:
If shipmethod missing from ShipViaPlus set the SO fields to NA or ERR etc., maybe send an email?
Trigger considerations -
Sales Order can be created via UI, CSV Import and most importantly via WebServices (EDI).
Seems like relatively simple logic but (alas) I have no suitescript skills (yet).
Given the basic script, I can create the custom record, play with the fields, etc.
If it winds up being a Workflow Action Script, I do have minimal Workflow understanding (define the parameters, I can at least create it).