Not able to print current.sys_id in email script

Gayathri5
Tera Guru

Hi Experts,

 

I have created a notification on "sc_req_item" table and this notification is triggerd by  event and event is present in workflow. 

In notification, i have used email script,and in email script i am trying to print RITM details using current.number, current.opened_at in template.print but unable to print because current.sys_id is not pointing to ritm record, what needs to be done, please help me its priority task for me.

 

Regards,

G

1 ACCEPTED SOLUTION

Hi,

you should pass the current object as event and notification is on sc_req_item table

Regards
Ankur

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

View solution in original post

9 REPLIES 9

Aman Kumar S
Kilo Patron

Can you share the event script?

Which object reference you are passing in the event as 2nd parameter?

Best Regards
Aman Kumar

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

I assume your workflow is running on RITM table?

share how are you triggering the event from workflow? screenshot

you must be passing wrong object to eventQueue()

regards
Ankur

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

Hi ankur, 

ya wf is on ritm table.

ya in event queue i am passing task object, how to get ritm details ?

Hi,

you should pass the current object as event and notification is on sc_req_item table

Regards
Ankur

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

Kartik Sethi
Tera Guru
Tera Guru

Hi @Gayathri 

Could you please confirm if the sys_id that you are getting is of the required RITM?

if this is the case then use the below script:

var ritmGr = current.getRefRecord();
//Now try printing the details
gs.info(ritmGr.number);

Also, confirm that:

  • Event Registry, Notification is on your sc_req_item table
  •  While triggering the event second parameter is your required GlideRecord Object

Please mark my answer as correct if this solves your issues!

If it helped you in any way then please mark helpful!

 

Thanks and regards,

Kartik