Thursday, April 11, 2019

Hide Field of Child Record in Sublist on a Parent Record but Make it Available for Scripting

Custom field related to a child record should be hidden from user on the parent record but it should be still available for scripting purposes at the same time.

The following steps allow to hide a field from users on a parent record sublist but make it accessible by SuiteScript.
It requires already created parent and child records (see Understanding Parent - Child Record Relationships page for more details).

  1. Customization > Lists, Records, & Fields > Record Types > select "Child record"
  2. Click on the name of field in order to hide in Fields sublist
  3. Set "Show In List" = T
  4. In Display subtab set Display Type = Hidden

Using the steps above the custom field will now be accessible e.g. by the following SuiteScript code example but the column will remain hidden for users in UI:

var parentRecord = nlapiLoadRecord('customrecord_parent')var hiddenField = parentRecord.getLineItemValue(   'recmachcustrecord_parent',   'custrecord_hidden_field');

No comments:

Post a Comment