Skip to main content

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 = dataTableRowsri];
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); 
}
}
}

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!


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


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 = dataTableRowsbi];
if (requestId=='658')
{

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

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

 

 


 

 

 


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