I have a field "udfchar23" in the Record view of WSJOBS screen. I have another tab "CLO". When I make change to a field in this "CLO" tab, say I change the status on this tab to completed and then save the tab from here. So I'm firing the aftersaverecord function & I want the field "udfchar23" present on the other tab to become protected. I'm doing it as follows:
aftersaverecord: function(){
console.log("Triggered after save function");
//var vField1 = field.getValue(),
vFormPanel = this.getFormPanel();
try {
var var1 = vFormPanel.getForm().findField("workorderstatus");
var var2 = var1.getValue();
console.log(var2);
var min_sev_level = vFormPanel.getFldValue('udfchar21');
console.log("Min Sev Level");
console.log(min_sev_level);
if (min_sev_level == '1' || min_sev_level == '2') {
if (var2 == 'C') {
console.log("Making protected in another tab");
EAM.Builder.setFieldState({'udfchar23':'protected'},vFormPanel.getForm().getFieldsAndButtons());
}
}
}
catch(err) {
console.log("Inside catch for afterloaddata function, doing nothing");
console.log(err);
}
}
But it's not making that field protected. Can anyone tell me how to do that?? Thanks.