- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2024 01:16 AM
In catalog form we have a field Vendor ID where users put the value, we have to create a new dependent variable on ID which checked if the ID is greater than E44555 then only the new variable should be visible. How will we compare this value
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2024 02:18 AM - edited 04-12-2024 02:43 AM
Hi @Abhilasha_123 ,
you can achieve this with the help of onChange Catalog Client script . Write a catalog client script on Vendor ID Variable and write a code on it as per below -
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '') {
g_form.setDisplay('new_field', false);
return;
}
if (newValue > 'E44555' && newValue != 'E44555') {
g_form.setDisplay('new_field', true);
} else {
g_form.setDisplay('new_field', false);
}
}
Scenario 1 - When form is loaded
Scenario 2- When Value is less than 'E44555 'or equal to is given
Scenario 3- When Value is more than 'E44555 ' is given
if my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2024 02:25 AM
Hi @Abhilasha_123 ,
I tried your problem in my PDI and I hope this will works for you
I created new "OnChange" Client script your can refer below code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
alert("ID - " + g_form.getValue('id'));
alert("ID New Value - " + newValue);
if (newValue > g_form.getValue('id')) {
alert('New Id value is greate ');
g_form.setDisplay('new_id_value', true);// show new ID Value
} else {
alert('New Id value is smaller');
g_form.setDisplay('new_id_value', false);// Not show new ID Value
}
}
Here the result
I added smaller number New ID value will removed
Please mark Correct and Helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2024 02:18 AM - edited 04-12-2024 02:43 AM
Hi @Abhilasha_123 ,
you can achieve this with the help of onChange Catalog Client script . Write a catalog client script on Vendor ID Variable and write a code on it as per below -
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '') {
g_form.setDisplay('new_field', false);
return;
}
if (newValue > 'E44555' && newValue != 'E44555') {
g_form.setDisplay('new_field', true);
} else {
g_form.setDisplay('new_field', false);
}
}
Scenario 1 - When form is loaded
Scenario 2- When Value is less than 'E44555 'or equal to is given
Scenario 3- When Value is more than 'E44555 ' is given
if my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2024 02:25 AM
Hi @Abhilasha_123 ,
I tried your problem in my PDI and I hope this will works for you
I created new "OnChange" Client script your can refer below code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
alert("ID - " + g_form.getValue('id'));
alert("ID New Value - " + newValue);
if (newValue > g_form.getValue('id')) {
alert('New Id value is greate ');
g_form.setDisplay('new_id_value', true);// show new ID Value
} else {
alert('New Id value is smaller');
g_form.setDisplay('new_id_value', false);// Not show new ID Value
}
}
Here the result
I added smaller number New ID value will removed
Please mark Correct and Helpful if this works for you
Thanks and Regards
Sarthak