How to show alert message when we impersonate to other user and try to update any record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 05:33 AM
We usually impersonate to other user to check any issue reported by that user. Later we forget that we are on impersonation and update other records unrelated to this user which will update the impersonated users name in the time stamps.
To avoid that , can we show an alert message whenever we try to update any record with impersonation. I see from docs that we can know the impersonated user and whether we are on impersonation with OOB functions. But where to write this script, for it to apply for all updates in the instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2022 01:22 AM
Hi @kamlesh kjmar ,
Thank you for your response. I have tried this solution and was able to see the message when we open a new tab or refresh the existing tab on impersonation. But if we update any already opened tab, it's not showing the alert. I think its because as we are setting the scratchpad value on display business rule. Checking for an option to show an alert on existing tabs as well.
Thanks,
Pallavi K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2022 04:49 AM
For the scenario you have mentioned, you can write one additional Before insert/update BR on Task table with below lines of code:
if(GlideImpersonate().isImpersonating()){
gs.addErrorMessage("Currently you are impersonated as "+gs.getUserDisplayName());
current.setAbortAction(true)
}
Regards,
Kamlesh