Skip to main content

How to set a field on mobile as read-only if it is other than empty?

Hi @WilsonX 

You can use a client script and attach it to the refresh event (Or any other relevant event).

var control = getControlValue('table','field');
if(isNullOrEmptyString(control)){
setControlEnabled("table","field",true);}
else{
setControlEnabled("table","field",false);}

Cheers!


Successfully resolved. thank you very much
1- I copied the default escript client used in the overview screen (do_refresh)
2- I created a new mobile-type script client
3- I pasted the copied script and at the end I included the script as instructed.

4- I changed the script used on the screen to the new one created in Refresh

var control = getControlValue("task", "user_def13");
if (isNullOrEmptyString(control)) {
setControlEnabled("task", "user_def13", true);
}
else {
setControlEnabled("task", "user_def13", false);
}

 


Reply