How to use pageinit script context function in the NetSuite.

Using this function in the NetSuite script this will show after the page completes loading or when the form is reset, we can set the values as default after the page reload also in NetSuite.

define(['N/error'],
    function(error) {
        function pageInit(context) {
            if (context.mode !== 'create')
                return;
            var currentRecord = context.currentRecord;
            currentRecord.setValue({
                fieldId: 'entity',
                value: 107
            });
        }

Leave a comment

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