Hello I've been trying to disable the Credit Limit...
# suitescript
f
Hello I've been trying to disable the Credit Limit standard field on Netsuite but I'm unable to do so. Is their a way to disable it. Within the Script I'm able to hided it but not disable it the reason is that we don't want other users to utilize the inline edit functionality:
Copy code
/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @NModuleScope SameAccount
 */
define(['N/record',
        'N/log',
        'N/ui/serverWidget',
        'N/runtime'],

function(record,log,serverWidget,runtime) {

    function beforeLoad_creditLimit(scriptContext){

      var form = scriptContext.form;
    	var field = form.getField({
    		id: 'creditlimit'
    	});
    	field.updateDisplayType({
    		displayType : serverWidget.FieldDisplayType.DISABLED
    	});
      log.debug({title:'Before Load Script',details: ' Exit'}); 
    }

     return {
        beforeLoad: beforeLoad_creditLimit
    };

});
I've tried the PageInit but it seems to still not function properly.
s
Copy code
/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @author 
 */
define([], function () {
    var exports = {};

    exports.beforeLoad = function beforeLoad(context) {
        context.form.getField({
            id: 'creditlimit'
        }).updateDisplayType({
            displayType: 'disabled'
        });
    }
    return exports;
});
this is working for me, must be something else in the script?
f
Thanks so much Sandii I will try this out maybe your right. It's my script.
s
I don't see anything wrong with that block, but idk maybe I'm missing something.