The CreatorCon Call for Content is officially open! Get started here.

I want to send notification to the forms not particular item

mania
Tera Contributor

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.

mania_0-1712745876524.png

Thanks!

10 REPLIES 10

@mania 

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

mania
Tera Contributor

@Maddysunil 

 

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.

mania_0-1712749266508.png

 

Thanks!

@mania 

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

mania
Tera Contributor

@Maddysunil 

 

I have tried not working.

 

Thanks!

@mania 

Please apply few logs inside if condition and debug