Change a Sublist Field Property Using SuiteScript 2.0

When using method isDisabled and an error is encountered, there is a workaround that involves using a different approach with updateDisplayType method.

/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 */
define([],


    function() {‌


        function beforeLoad(scriptContext) {‌
            scriptContext.form.getSublist('item').getField('description').updateDisplayType({‌displayType:'disabled'});


            scriptContext.form.getSublist('item').getField('description').updateDisplayType({‌displayType:'hidden'});


        }


    return {‌
        beforeLoad: beforeLoad,
    };


});

Leave a comment

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