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?

Rookie Asked on June 10, 2020 in SuiteScript.
Add Comment
3 Answer(s)

Check the to and from subsidiary on the transfer order, if they are different then it is intercompany?

Intermediate Answered on June 10, 2020.
Add Comment

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

Rookie Answered on June 10, 2020.
Add Comment

You could query the record for the column multisubsidiary. That is:


search.lookupFields({type: 'transferorder', id: 123, columns: ['multisubsidiary'] });
Beginner Answered on June 17, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor