Suitescript – identify Intercompany Transfer Order vs Transfer Order
Hi – We have a requirement in our suitescript to identify an Intercompany Transfer Order (ITO) from the Item Receipt object upon receiving (item receipt create). While it’s possible for us to identify a traditional TO using the ‘createdfrom’ key, we still get a false positive for ITO. For example, the following would not fail (catch) if the created from record were an ITO.
try {varTO=record.load({id: createdFromId,type: record.Type.TRANSFER_ORDER});} catch (error) {log.debug({title: "NOT a TransferOrder",details: JSON.stringify(error)});returnerror;}
Is there a way to correctly identify an ITO vs a TO from the Item Receipt level?
Check the to and from subsidiary on the transfer order, if they are different then it is intercompany?
interesting approach….i can see only subsidiary key on the TO in a script (not a to and from)- That being said, i guess i could look at the subsidiary of the TO and the subsidiary of the item receipt and compare those. I’ll give a shot
You could query the record for the column multisubsidiary. That is:
search.lookupFields({type: 'transferorder', id: 123, columns: ['multisubsidiary'] });