Write the script on the notification

PRAGHATIESH S
Tera Expert

I created one notification on approval table and need to write a advanced condition when subcategory doesn't contains "Lease" word email will trigger and if it's contain that word, won't trigger. Can someone help here.

2 REPLIES 2

HrishabhKumar
Kilo Sage

Hi @PRAGHATIESH S ,

You can add script in the "advance condition" to fullfill this requirement.

I have provided the script below, feel free to make custom changes in it.

// Check if the subcategory does not contain the word "Lease" 
if (current.subcategory.indexOf("Lease") == -1) {
    answer = true;
} else {
    answer = false;
}

 

Thanks,

Hope this helps you! Let me know by accepting the solution and giving a thumbs up!

 

surajchacherkar
Mega Guru

Hi @PRAGHATIESH S ,

 

use below script in advance condition of notification, I tested in PDI its working fine, 

 

// Check if the current record's subcategory contain the word "Lease" if Yes then do not trigger else trigger notif
if (current.short_description.includes('Lease')) { // change short_description with subcategory backend name
	answer = false; // Do not trigger the notification
} else {
      answer = true; // Trigger the notification 
}

 

FYR:

surajchacherkar_0-1718268741414.png

 

If my response helped you, please click on "Accept as solution" and mark it as helpful.


Thanks

Suraj