Thursday, March 28, 2019

Editing Search via SuiteScript Erases the Search ID

This article details how to work around the issue where calling nlobjSearch.saveSearch('name') erases the Search ID when it is viewed in the page

This happens because there is an existing Defect wherein if you don't specify the 2nd parameter in nlobjSearch.saveSearch, it is set to null when viewed in the Search Definition page.

To resolve the issue, specify the 2nd parameter (scriptId) when saving the search. To illustrate:

var search = nlapiLoadSearch('customer', scriptId);
var id = search.saveSearch('Modified Search', scriptId);

No comments:

Post a Comment