RE: 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?

radrunner Rookie Asked on June 10, 2020 in SuiteScript.
Add Comment
3 Answers

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.