Issue in setting a custom field value automatically using client script (field changed) during the inventory item creation.

In inventory item creation , when selecting a parent item (sub item of) i need to set the value of some custom fields in child similar to its parent item, like category type and attribute types. I have used field changed event in client script to automatically set the values corresponding to its parent item. search and find the field values from Parent item record using “search.lookupFields”. Each custom item field is list/record type. the “setValue” method works except for one field. (which has done sourcing and filtering with its previous field. ) .

1 comment

  1. Issue resolved:
    The reason behind this is that the Netsuite UI action is slower than the script performance. Here i have set filter option in that corresponding field. This field lists the values of the previous field. when script executes, every time perform the action(setValue()). After the script stops the UI performs the filter action and clears the field value. That’s why the set value is not seen. In solution i have added
    setTimeout(function ()
    {action},
    1000); –>this action lasts for 1000ms, meanwhile the UI filter action completes. Thus we can set our value in the corresponding field.

Leave a comment

Your email address will not be published. Required fields are marked *