Widget gs.eventQueue throws error - 'The event is not defined'.

Sadrudeen Ashr1
Tera Expert

Friends, 

I use gs.eventQueue to call my event trigger in UI action which works fine. 

When I use the same gs.eventQueue in Widget to call my event trigger I get the below error message, 

Kindly help on how to define an event in Widget.

 

"Access to event '(event name)' from scope 'Service Portal - Standard Ticket' has been refused. The event is not defined."

1 ACCEPTED SOLUTION

Thanks for your reply, Resolution is like Pradeep Sharma advised "Can you create an event in the same scope and try once. Leave the table field to blank."

I have created the event in the Same scope of my widget and left the table field to blank, 

to my surprise it worked with no issues. 

 

https://www.servicenow.com/community/developer-forum/incident-application-and-event/m-p/2093327#M750...

View solution in original post

7 REPLIES 7

AnubhavRitolia
Mega Sage
Mega Sage

@Sadrudeen Ashr1  

 

This may be Scope issue. IF your Widget and Event Registry are on different Scopes, you need to provide Cross Scope Privilege access using 'sys_scope_privilege' table.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Thanks for your reply, I tried providing privilege,

My Widget scope is "Service Portal - Standard Ticket" and the Event which I placed is in "Global", 

Then Event will be triggered from "Incident Standard Ticket Actions" widget - which I think it is Source scope,

but when I create new scope privilege I am not able to change from "Global" to "Service Portal - Standard Ticket" and if I tried to have Source as "Global" and Target as "Service Portal - Standard Ticket" I get this error in the attached image issue, kindly help. 

SadrudeenAshr1_0-1665487104431.png

 

Create Cross Scope Privilege in "Service Portal - Standard Ticket" (Change your scope to "Service Portal - Standard Ticket")

 

Target Scope - Global

 

No try with Different Target Type and provide Read/write access and see if this resolve your issue.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

New scope creation worked as you said,

SadrudeenAshr1_0-1665490351537.png

 

but I get the same error message again, 

 

SadrudeenAshr1_1-1665490404925.png

 

"Access to event 'Incident Escalation Event' from scope 'Service Portal - Standard Ticket' has been refused. The event is not defined."

FYI, My widget is in scope - "Service Portal - Standard Ticket" and my Event - "Incident Escalation Event" is in Global Scope, 

 

below is the code I have it in my widget - 

gs.eventQueue('Incident Escalation Event', incidentGr, 'incidentGr.assignment_group.email', 'incidentGr.assignment_group.manager.email');