Skip to main content
Solved

FSM Mobile - conditional read-only field

  • February 16, 2024
  • 2 replies
  • 53 views

WilsonX
Sidekick (Employee)
Forum|alt.badge.img+6

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

Best answer by Shneor Cheshin

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!

2 replies

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • Answer
  • February 16, 2024

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!


WilsonX
Sidekick (Employee)
Forum|alt.badge.img+6
  • Author
  • Sidekick (Employee)
  • February 17, 2024

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);
}