Cilent scipt

nameisnani
Mega Sage

Hi Team ,

 

Catalog Build 

 

When ever user selects [ Request Category >> Production access ] , Then short desp and Descp field should be not visible .

 

NOTE :- Short descp and descp fields coming from the variable set .

 

Can anyone please help me here , 

 

nameisnani_0-1709714448384.png

 

Thanks in advance 

 

1 ACCEPTED SOLUTION

shyamkumar VK
Kilo Patron

@nameisnani , You can Write on Change Client Script on Request Category and use below script 

 

var access = g_form.getValue('request_category) // replace with correct variable name 
if(acess=='production access'){
g_form.setMandatory('variablename', false);
g_form.setVisible('variablename', false);
}

 

 
UI Policy based on Condition like Request Category is Production Access , Create UI Policy Actions for both Short Description - Make Visible to True and Mandatory to False on both Variables 
 
Short Description - Visible False - Mandatory False 
Description - Visible False - Mandatory False 
 
Regards,
Shyamkumar
 
Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

View solution in original post

18 REPLIES 18

Yes , Variable set is we are using for other item also , Any client script suggestions

Hi @nameisnani ,

In that case you can write a onLoad Catalog Client Script to hide those variables using the g_form API.

 

Please mark helpful/correct if my response helped you.

@Anubhav24  , On Load work here ? .... it should be On change right ?

 

@nameisnani  yes you are right I missed that point , onChange Client Script. You can build a condition in your client script if the value receieved from request category is "prod access" then hide the fields. I think as our colleagues have mentioned to use the condition in UI Policy you should try that first.

 

Please mark helpful/correct if my response helped you.

go for ui policy on the catalog variable set instead. Dont create Client script.


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect