Skip to main content
Question

FSM Web Client

  • October 16, 2024
  • 5 replies
  • 78 views

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

Dear All,

 setcontrolvisibility for web client is not working while hiding the field in row level.

I am trying to hide 2 3 fields under part_need tab its not working . below is my script 

Please let me  know why this functionality not working or anything I am missing here in the below script to hide the fields in row level.

 

 

var dataTableRows = getDataTableRows('part_need');
var accessgroup= getControlValue('task','access_group');
if(size(dataTableRows) > 0)
{
for(var i=0; i<size(dataTableRows); ++i)
    {
      var row = dataTableRows[i];
if (accessgroup == 'ELUX_BE' || accessgroup == 'ELUX_CA' || accessgroup == 'ELUX_DK' || accessgroup == 'ELUX_LU' || accessgroup == 'ELUX_NL')
{
    alert(accessgroup);
    
   var Seename=getRowControlValue(row, 'part_need','user_def16');
   alert(Seename);
   
setRowControlVisibility(row, 'part_need', 'user_def16', false); 
setRowControlVisibility(row,'c_ecc_part_reservation_status','tracking_id',false);
setRowControlVisibility(row,'c_ecc_part_reservation_status','carrier_name',false);
        
    }      
else
{
setRowControlVisibility(row,'c_ecc_part_reservation_status','tracking_id',true);
setRowControlVisibility(row,'c_ecc_part_reservation_status','carrier_name',true);
setRowControlVisibility(row,'part_need','user_def16',true); 
}
}
}

5 replies

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • 1143 replies
  • October 17, 2024

HI @Pinmaya Kumar Singh 

This function is not supported on tabs/rows/lists.

For example, you might have 5 rows. Three of them fulfil the condition and need to be hidden, and the other 2 do not. It is impossible to hide a column in a table selectively.

I hope that makes sense to you.

Instead, you can consider disabling the field.

Cheers!


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

Hi @Shneor Cheshin Thanks for the input will try to disable the fields in row level….


SAMLK
Hero (Partner)
Forum|alt.badge.img+13
  • Hero (Partner)
  • 233 replies
  • October 22, 2024

Hi @Pinmaya Kumar Singh 

Are you testing this on the TASK screen on web client (Just checking as you are directly fetching the task_id from the control)? 

I have just tested this functionality of hiding the rowcontrol visibility of task list on the REQUEST screen with the sample code below and it’s working fine for me (it will not hide the entire column, but should hide the control value selectively based on the condition checks). Row control visibility function is supposed to set the visibility of the control specified by the supplied parameters to the supplied value. 

Please check whether the access group is attached to the task table as well. 

You can test the sample code on the REQUEST screen by adding the client script on the UI Designer Add Edit Events (AfterDataLoad event)

var dataTableRows = getDataTableRows('task');
var requestId = getControlValue('request','request_id');
if(size(dataTableRows) > 0)
{
  for(var i=0; i<size(dataTableRows); ++i)
    {
      var row = dataTableRows[i];
		if (requestId=='658')
		{

		   setRowControlVisibility(row, 'task', 'task_status', false); 

		} 
		else
		{
			setRowControlVisibility(row, 'task', 'task_status', true); 
		}
	}
}

 

 


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

 

 

 


SAMLK
Hero (Partner)
Forum|alt.badge.img+13
  • Hero (Partner)
  • 233 replies
  • October 23, 2024

Hi @Pinmaya Kumar Singh 

Please check whether the access group is picked correctly and whether you have called the script in the correct event.


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