Error Message: Illegal access to method isImpersonating() in class com.glide.sys.GlideSession

Community Alums
Not applicable

I am getting an Error Message: Illegal access to method isImpersonating() in class com.glide.sys.GlideSession

find_real_file.png

I started getting this error message from a business rule I have created

find_real_file.png

 

Please help me fix the issue.

3 ACCEPTED SOLUTIONS

Hi Rajasekhar,

you can use that in scoped app BR on incident table for example

Condition: Work notes changes

Script below:

var isImpersonator = gs.getSession().isImpersonating();

if(isImpersonator){
gs.addErrorMessage('You are not allowed to edit work notes as you are impersonator');
current.setAbortAction(true);
}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

Hi,

Any update on this?
Can you mark my answer as correct, 👍 helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
 
Regards
Ankur

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

View solution in original post

Gaurav Shirsat
Mega Sage

Hi Rajasekhar

You can take help of the below link but as Ankur Said this might be the case that you are using this method in scoped app.

https://hi.service-now.com/kb_view.do?sysparm_article=KB0694685

also check below widget codes how to use this isImpersonate class

https://community.servicenow.com/community?id=community_article&sys_id=a27e9ad7db186388feb1a851ca961...

Please Mark Correct and Helpful

Thanks and Regards

Gaurav Shirsat

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

this line of code should work in scoped app; I think it gives issue for global scope

what you want to achieve here?

Regards
Ankur

 

 

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

Community Alums
Not applicable

I need to restrict users from updating work notes when they impersonate as some other user.

I need to achieve this both in scoped and global apps

Hi Rajasekhar,

you can use that in scoped app BR on incident table for example

Condition: Work notes changes

Script below:

var isImpersonator = gs.getSession().isImpersonating();

if(isImpersonator){
gs.addErrorMessage('You are not allowed to edit work notes as you are impersonator');
current.setAbortAction(true);
}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi,

Any update on this?
Can you mark my answer as correct, 👍 helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
 
Regards
Ankur

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