Solved

FSM WebClient - Is it possible to control the visibility of a field based on the tab shown?

  • 23 April 2021
  • 5 replies
  • 212 views

Userlevel 3
Badge +7

Hi all,

 

We have a requirement from our client where we need to control fields visibility based on Request Type. Using client script we can easily do this, our problem is that some fields appear on two different tabs (for the same request type it should be visible on TAB A but not on TAB B). 

 

Do you know if it is possible to control the visibility on a specific tab? Or if there is any event we can use to trigger the script (we tried the GotFocus event, but nothing happened)? We also tried to use the name to register property of the field at UI Designer, but it seems the setcontrolvisibility function only accepts the “real” DB field name on the DB…

 

Thanks in advance,

João Oliveira

icon

Best answer by nickz 29 April 2021, 10:22

View original

This topic has been closed for comments

5 replies

Userlevel 3
Badge +6

Hi @ZRZJOLIVEIRA 

This is script to hide the Contact tab on a screen.

You can use this as basis to understand the logic and adjust it with your parameter.

var screenName=getCurrentScreenName();
var viewID='';
if(screenName=='OPPORTUNITY')
    viewID='oppty_contact';
else if(screenName=='PLACE' || screenName=='REPAIRPORTALPLACE' || screenName=='TECHPORTALPLACE')
    viewID='place_contact';
else if(screenName=='PRODUCT' || screenName=='DEALERPORTALPRODUCT' || screenName=='REPAIRPORTALPRODUCT' || screenName=='TECHPORTALPRODUCT')
    viewID='product_contact';
else if(screenName=='QUOTE' ||
    screenName=='WFDEMOPPTYQUOTE' ||
    screenName=='WFDEMOQUOTECONTRACT' ||
    screenName=='WFDEMOQUOTENONPART' ||
    screenName=='WFDEMOQUOTEPART' ||
    screenName=='WFQUOTE' ||
    screenName=='WFQUOTECONTRACT' ||
    screenName=='WFQUOTENONPART' ||
    screenName=='WFQUOTENONPARTREQUEST' ||
    screenName=='WFQUOTENONPARTRMA' ||
    screenName=='WFQUOTEPART' ||
    screenName=='WFQUOTEPARTREQUEST' ||
    screenName=='WFQUOTEPARTRMA')
    viewID='quote_contact';
else if(screenName=='REQUEST' || screenName=='TECHPORTALREQUEST' || screenName=='WARRANTYCLAIMS' || screenName=='DEALERPORTALWARRANTYCLAIMS')
    viewID='request_contact';
setControlVisibility(viewID,'import_contact',false);
setControlVisibility(viewID,'export_contact',false);

Best regards,

Sven

 

Userlevel 3
Badge +6

@ZRZJOLIVEIRA 

In the case the view ID is missing, you need to create a new one in the UI designer. 

Please note, this is not related to the name to register. 

Best regards,

Sven

Userlevel 3
Badge +7

Hi,

 

Thank you very much for your comments, but we are trying to hide one field on a specific tab (not the tab itself).

 

Best regards,

João Oliveira

Userlevel 6
Badge +19

a workaround suggestion…. copy the field into a user_def, then make the user_def visible or not instead?

Userlevel 3
Badge +7

Hi nickz,

 

Thank you for the suggestion...it’s not perfect (another field on the data model, new BR to copy the value from one field to another., etc) but it works.

 

Best regards,,