I want to disable the field `amount` in the Purcha...
# suitescript
e
I want to disable the field
amount
in the Purchase Order form, but the code is not working for that specific field. Other fields can be disabled using the same code. Any idea?
Copy code
function pageInit(scriptContext) {

        var currentRecord = scriptContext.currentRecord;

        var objSublist = currentRecord.getSublist({sublistId: 'item' });    
 
        var objColumnGrossAmount = objSublist.getColumn({fieldId: 'grossamt'});
        var objColumnAmount = objSublist.getColumn({fieldId: 'amount'});
        
        objColumnGrossAmount.isDisabled = true;
        objColumnAmount.isDisabled = true;  
          
    }
c
Can you just disable it at the form level instead?
e
No, no option for that field.
b
expect to have to also do it post sourcing as well, netsuite will undisable fields it uses
e
Wow!!! Post Sourcing was the solution, thanks!!!... Is this behavior documented? Or is it along the lines of "of course it works that way if you know x"? 🤔
b
experience thing, some fields are more annoying to disable than others
✅ 1