Is it possible to make a field on a sublist row di...
# suitescript
j
Is it possible to make a field on a sublist row disabled in SS2?
s
I haven’t tried to do the disabled function, but I did use SS2.0 to set field to Mandatory. Perhaps try the code below with “isDisabled” - True?
objForm.getSublist(key).getField(obj[key]).isMandatory = true;
Copy code
function setLineFieldMandatory(form, data){
            var objForm = form;
            var sublistFields = data;

            try{
                for (var i in sublistFields){
                    var obj = sublistFields[i];
                    for (var key in obj){
                        objForm.getSublist(key).getField(obj[key]).isMandatory = true;
                        log.audit('Set to Mandatory', 'Form: ' + objForm.title + ', Sublist: ' + key + ', Fields: ' + obj[key]);
                    }
                }
            }catch(e){
                log.error('setLineFieldMandatory', (e.name || e.getCode()) + ":" + (e.message || e.getDetails()));
            }
        }