Unable to set caller field readonly with setReadOnly()

SanjivaniLahane
Tera Contributor
function onLoad() {

    //g_form.setReadOnly("description", true);
    //alert(g_form.isReadOnly("description"));


    //g_form.setDisplay("short_description", false);
    g_form.setMandatory("caller_id",false);
    g_form.setValue("caller_id",g_user.userID);
    g_form.setReadOnly("caller_id", true);
    alert("done");
    //g_form.setReadOnly("u_caller", true);

}

 

5 REPLIES 5

Jagadish Sanadi
Kilo Sage

Hello @SanjivaniLahane 

SInce caller field is mandatory, 

you need to have value and then make mandatory false after that make read only.

Please use below steps

 

g_form.setValue("caller_id", g_user.userID);
g_form.setMandatory("caller_id", false);
g_form.setReadOnly("caller_id", true);

 

Please mark if I have answered you