- 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 07:42 PM
Hi Jessica,
To create a client script for a specific Catalog Item, you must create it from the "Catalog Client Script" module.
MVP 2025 ✨
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 09:06 PM
Hi @Isaac Vicentini ,
I could not find the "Quantity" field on the catalog item dropdown. Please advise. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 05:45 AM - edited 04-24-2024 05:49 AM
In the Type field, you should select onChange.
In the Catalog Item field, you should select name of your Catalog Item.
Once you do this, in the "Variable name" field, the "Quantity" variable will be available.
MVP 2025 ✨
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 08:21 AM
I understand that it will work if the "Quantity" is a variable type. However, the "Quantity" is actually field type on the form.