Skip to main content
Question

FSM Mobile Hide Fields

  • November 6, 2024
  • 2 replies
  • 32 views

Pinmaya Kumar Singh
Do Gooder (Partner)
Forum|alt.badge.img+5

Dears,

Can someone guide me what I need to write exactly to hide few fields in Mobile based on access group. For web client I have done it for mobile how it can be done?

Below is my mobile script to hide the fields let me know anything I am missing in the script.

Requirement

In mobile I am trying to hide user_def16 and user_def17 from part_usage table and bin_id from stock_bin table based on the access group (which is ‘ELUX_US’) .

 

 

var taskId = getCurrentKeys("task", "task_id");
var partUsage=getCurrentKeys
var binID=getCurrentKeys
var AccessGroup = getDBValue(stringFormat("SELECT access_group FROM task WHERE task_id = {0}");
if (AccessGroup == 'ELUX_US') 
{    
    setControlVisibility('part_usage','user_def16',true);
    setControlVisibility('part_usage','user_def17',true);
    setControlVisibility('stock_bin','bin_id',true);    
}           
else
{
    setControlVisibility('part_usage','user_def16',false);
    setControlVisibility('part_usage','user_def17',false);
    setControlVisibility('stock_bin','bin_id',false);
    
}

 

 

 

 

2 replies

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • 1138 replies
  • November 7, 2024

Hi @Pinmaya Kumar Singh 

  • What is the value you get for AccessGroup ?
    • Try adding alert(AccessGroup); to see the value.
  • Your query should be all lower case letters. SQLite is case sensetive.
  • You can also try running your query on the mobile DB. Are you getting results?

Also, not sure if this is a typo but you are missing parameters in the function getCurrentKeys in the second and third lines.

 

Cheers!


Forum|alt.badge.img+6
  • Do Gooder (Partner)
  • 37 replies
  • November 7, 2024

@Pinmaya Kumar Singh apart from the above comment feedback you also need to use the correct syntax for the StringFormat function.

It needs to be corrected as following, otherwise query result will be null

 

 

var AccessGroup = getDBValue(stringFormat("SELECT access_group FROM task WHERE task_id = {0}",taskId));

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings