- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 04:48 PM
Hello,
I have an onChange type client script that reload the form after updated. I need help with the script to trigger only one catalog item. Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 10:20 PM
Hi @Jessica28 ,
You want this script(which you attached) to only trigger for one specific catalog?
If yes, then you can modify it like this-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var catalogItemSysId = 'your_catalog_item_sys_id_here'; // Replace 'your_catalog_item_sys_id_here' with the sys_id of your catalog item
var currentCatalogItemSysId = g_form.getValue('cat_item');
if (currentCatalogItemSysId === catalogItemSysId) {
// Add your condition here, if needed
location.reload(); // Reload the form
}
}
Please mark as Accepted Solution if this solves your query .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 10:20 PM
Hi @Jessica28 ,
You want this script(which you attached) to only trigger for one specific catalog?
If yes, then you can modify it like this-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var catalogItemSysId = 'your_catalog_item_sys_id_here'; // Replace 'your_catalog_item_sys_id_here' with the sys_id of your catalog item
var currentCatalogItemSysId = g_form.getValue('cat_item');
if (currentCatalogItemSysId === catalogItemSysId) {
// Add your condition here, if needed
location.reload(); // Reload the form
}
}
Please mark as Accepted Solution if this solves your query .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 08:31 AM
Hi Jessica,
I know you have had your answer but could I ask what the use case is here please?
Just being nosey.