- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 06:19 AM
Hi!
We created a BR to send notification whenever the field changes: either "People lead" field changes or "Project executive" field changes.
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 06:27 AM
Hi @Dizy M
here in script use if (current.people_lead.changes()){ and in else if also use current.project_executive.changes()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 06:41 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 06:27 AM
Hi @Dizy M
here in script use if (current.people_lead.changes()){ and in else if also use current.project_executive.changes()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 06:32 AM
Hi,
Change the condition On line 3 change as below
if(current.people_lead != previous.people_lead)
do same for line 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 06:41 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader