Using a user event script, what is the best way to...
# suitescript
s
Using a user event script, what is the best way to determine the record.Type of the "Created From" record on an item Fulfillment? I need the script to behave differently if the item fulfillment is created from a sales order or transfer order.
e
Maybe
var recordType = search.lookupFields({
type: search.Type.TRANSACTION,
id: internalid,
columns: 'type'
});
e
From the SO or TO you can load the record and then inspect the links sublist which has a field called type.
e
I prefer
lookupFields
for quick lookups,
record.load
is more intensive for a single column query
n
if you use "recordtype" instead of type in your lookup you can compare it using the record.Type. enum.