Onchange of two variables in catalog client script

Community Alums
Not applicable

Hello 

 

Is it possible to write catalog client script when onchange of two variables ?

5 REPLIES 5

Amit Verma
Kilo Patron
Kilo Patron

Hi @Community Alums 

 

No, you can't. You need an onChange client script for each field. You need to have individual client scripts for each of your variable.

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Community Alums
Not applicable

Thank you for the response

Robbie
Kilo Patron
Kilo Patron

Hi @Community Alums,

 

An onChange script is based upon and associated to a single field. If two (or more fields) need to be watched or monitored, additional Client Scripts are required.

Depending on your requirement, please take a look at and explore the use of UI policies where you have the ability to configure multiple conditions. Here you may be able to capture your requirement and monitor different values but sadly you won't be able to get the previous value or the 'changes to' / 'changes from' condition.... it really depends on your requirement.

 

However, in order to answer your question directly - high level, whilst you can reference multipole fields and within the script body of an onChange script, the script itself is associated to and 'watches' a single field.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @Community Alums ,

 

One change client scripts run on fields which are selected in > 'Onchange' field of client script form. So here we cannot select 2 field at once. Hence its not possible...

 

you need to create 2 different onchange client scirpts for each field. i hope this helps...


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

LinkedIn - Lets Connect