Solved

Button hide through client script

  • 3 September 2021
  • 3 replies
  • 71 views

Userlevel 2
Badge +2

Hi,

I am trying to hide button based on request type from below client script ,I have given event type as selectionchanged. It is working for smart client not for web client. please suggest how to reflect same for web client.

 

var REQTYPE = getControlValue('REQUEST','REQ_TYPE');

if (REQTYPE == 'BASIC' ||
    REQTYPE== 'FIX')
{
      setControlVisibility("addNote", false);
      
}
else
{
    setControlVisibility("addNote", true);
}
return false;

 

Regards,

Ramya

icon

Best answer by Atheeq Maharoof 6 September 2021, 19:03

View original

3 replies

Userlevel 5
Badge +9

Hi @RamyaR ,

Create a client script with the below values. 

 

Client Script - Web Client Only

Client Script code - 


var REQTYPE = getControlValue("request","req_type");

if (REQTYPE == 'BASIC' ||
    REQTYPE== 'FIX')
{
      setControlVisibility("addNote", false);
      
}
else
{    
    setControlVisibility("addNote", true);
}
return false;

Make sure to attach the client script with the request_type in the UI Designer for AfterValueChanged event.

UI Designer - Customized screen

 

Save the new screen and make sure to refresh the cache in the web client. Following are the output seen in the web client when the request type is changed. 

 

Request Type = ‘Basic’, “New” button has been hidden.


 

Request Type = ‘Return’, “New” button is visible.



Hope the above answer helps to achieve your requirement. 

Best Regards,
Atheeq

Userlevel 2
Badge +2

@Atheeq Maharoof thanks for the detailed explanation, I followed same steps but It’s not working in web client. If I do same for smart client it is working, Not sure what I am missing. I am using FSM 6.8 version.

 

Regards,

Ramya

 

 

Userlevel 5
Badge +9

Hi @RamyaR,

I just wanted to provide you some points to check why its not working. I am using FSM6UPD9

Upper case values

When changed the script as above where getControlValues contains “REQUEST” and “REQ_TYPE”, it did not work for me as well. Using lower case values solved this issue. 

 

Lower case values

  Please make sure to select the client type as “Web Client Only”.


Hope the above answer helps to solve your issue.

Best Regards,
Atheeq

Reply