- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 01:03 AM
Hello.
I created an onChange catalog client script that, when a variable on a portal form is changed, returns it to its original value if the condition does not apply.
However, when I executed it, I found that it was being executed multiple times for some reason. Does anyone have any idea what the cause is?
onChange target variable name: linkage
script:
var priceTrigger = g_form.getValue('price_trigger');
if (priceTrigger == 'false' && newValue == "necessary") {
alert("Revert to original value!");
g_form.setValue('linkage', 'unnecessary');
}
Regards,
Ro
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2023 11:26 PM
I received a message from support saying that this issue may be a bug and will file a problem case.
Therefore, I will close this question.
Thank you to everyone who responded.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 01:30 AM
hi try below code
var priceTrigger = g_form.getValue('price_trigger');
var linkageValue = g_form.getValue('linkage');
if (priceTrigger == 'false' && newValue == 'necessary' && linkageValue !== 'unnecessary') {
alert("Revert to original value!");
g_form.setValue('linkage', 'unnecessary');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2023 11:26 PM
I received a message from support saying that this issue may be a bug and will file a problem case.
Therefore, I will close this question.
Thank you to everyone who responded.