Saturday, February 2, 2019

External ID Search in SuiteScript

It is necessary to uppercase the external ID when using it as a search filter in SuiteScript.  Otherwise, SuiteScript Search APIs will return zero results.  Use toUpperCase() function to convert a string to uppercase.

For example, a Customer record has an External ID of "Ext-entity-jeff-12345", the search format should be:

     var s = nlapiSearchRecord(
          [new nlobjSearchFilter('externalid', null, 'is',  ('Ext-entity-jeff-12345').toUpperCase() )],
          [new nlobjSearchColumn('firstname')]

No comments:

Post a Comment