I want to send notification to the forms not particular item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 03:46 AM
Hi,
This is the OOB notification, here It is sent to all the records but i want to sent this notification to all forms but except one particular catalog item form.
Can you please help on this, It will be usefull.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 04:31 AM
Basically current.document will give the sysid of current ritm(see the attachment) and with the help of ritm sysid you can get the catalog name. Also correct below line in the code
function isCatalogItemXYZ(document) {
var catalogItemGR = new GlideRecord('sc_cat_item'); // Assuming 'sc_cat_item' is the table name for catalog items
if (catalogItemGR.get(document)) {
// If a catalog item is found with the specified sys_id, check if it's for XYZ
if (catalogItemGR.getDisplayValue('cat_item') == 'XYZ') {
return false; // The document is a catalog item for XYZ
}
}
return true; // The document is not a catalog item for XYZ
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 04:41 AM - edited 04-10-2024 04:42 AM
I have tried which you provided but that notification has sent to 'XYZ' catalog item also, but I dont want to send that particular item.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 04:48 AM
If you are using sysid of catalog item then just use getVlaue() instead of getDisplayValue()
catalogItemGR.getValue('cat_item')=='sysid'
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 05:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 05:32 AM
Please apply few logs inside if condition and debug