If I have a custom record that is a child of a tra...
# suitescript
j
If I have a custom record that is a child of a transaction record, with a field on the custom record called custrecord_myrec_transaction, what is the best way in SS2 to determine the type (e.g. Sales Order, Invoice, Vendor Bill) of the transaction that the child record is on (from the child record)?
b
transaction search or query to get the record type
second best is using another field to source the type if you are willing to write a lookup to convert the name to the id
e
Do an https.get to the URL - https://xxxxxx.app.netsuite.com/app/accounting/transactions/transaction.nl?id=RECORDID. NS will translate the URL to the appropriate form and if you add &xml=T you can parse the XML for baserecordtype. Otherwise you can use the form type used on the URL (itemship.nl, salesord.nl etc...) to translate it to record.Type enums.
j
dang
was hoping for cheaper/shorter solution
thanks, I’ll use the search method.
argh
I’m still going to have to convert to the
record.Type
why are there two sets of labels, it sucks
e.g.
salesorder
vs
SalesOrd
b
recordtype is an actual column
j
ohhhh
there we go
still don’t know why they have two different things, it’s confusing
b
likely answer is transaction types predate suitescript