Wednesday, June 5, 2019

Save Custom Item Field Value from Summary Search Result

In order to save the value from Summary Search result Field create a custom Item Field, with Store Value box property checked. This field will be set by a User Event SuiteScript. The SuiteScript is triggered on Before Submit event and sets the value of the new custom Field to the value of the Summary Search result Field.

  1. Create a custom Item field
    • Go to Customization > Lists, Records, & Fields > Item Fields
    • Set the following values:
      Label = Item Field set by SuiteScript
      Type = Free-Form Text
      Store Value = Checked
      On Applies To subtab:
      Inventory Item = Checked
      Click Save
  2. Create and Deploy a User Event script on Before Submit trigger (as described in User Event Scripts SuiteAnswers article). 
    Example of the script:

    ..
    var storeValue = nlapiGetFieldValue('internal id of the field with the saved search');
    nlapiSetFieldValue('internalid of the new item field', storeValue);
    ..

Note: The nlapiGetFieldValue, and nlapiSetFieldValue APIs are described in SuiteAnswers article Field APIs.

No comments:

Post a Comment