Business Rule (after Update)

Dizy M
Tera Expert

Hi!

We created a BR to send notification whenever the field changes: either "People lead" field changes or "Project executive" field changes.

DizyM_0-1699279917858.png

 

DizyM_1-1699280058504.png

 

The above script seems not working at all coz i dont receive any email. This script should check after update of the form if the "People Lead" field have changed , if its changed then it will send notif for People lead and cc is the previous People Lead. . And, if the "Project executive" field have changed , then it will send a diff email notification and the cc will be the previous project executive.

 

Im not sure why its not working....  I also tried "if (people_lead.changes()){" but still not working...  

 

I'd appreciate any help. Thank you!

2 ACCEPTED SOLUTIONS

yaswanthi2
Giga Sage

Hi @Dizy M 

here in script use if (current.people_lead.changes()){ and in else if also use current.project_executive.changes()

View solution in original post

Ankur Bawiskar
Tera Patron
Tera Patron

@Dizy M 

line 3 and 6 are wrong. you are using changes() function in wrong manner. you should use current object with field and then use changes(). Also ensure the values are not empty while sending email. If it's empty then no point in triggering the event

it should be this for line 3

if(current.people_lead.changes() && current.people_lead!='')

line 6 should be this

if(current.project_executive.changes() && current.project_executive != '')

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

yaswanthi2
Giga Sage

Hi @Dizy M 

here in script use if (current.people_lead.changes()){ and in else if also use current.project_executive.changes()

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Change the condition On line 3 change as below

 

if(current.people_lead != previous.people_lead)

 

do same for line 6

 

 

-Anurag

Ankur Bawiskar
Tera Patron
Tera Patron

@Dizy M 

line 3 and 6 are wrong. you are using changes() function in wrong manner. you should use current object with field and then use changes(). Also ensure the values are not empty while sending email. If it's empty then no point in triggering the event

it should be this for line 3

if(current.people_lead.changes() && current.people_lead!='')

line 6 should be this

if(current.project_executive.changes() && current.project_executive != '')

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader