Business Rule condition ignore if trying to impersonate

nathan34
Giga Contributor

I have an onBefore business rule that limits user query results based on which domain a user exists in.   This rule interferes with trying to impersonate back to myself from a non-admin user (causes me to have to logout and log back in as myself).

Is there a condition I can write that will ignore this business rule if trying to impersonate?

1 ACCEPTED SOLUTION

nathan34
Giga Contributor

The working solution I used was posted on here but must have been removed.



I added !gs.getImpersonatingUserName() to the condition line in my Business Rule script and am now able to successfully impersonate back to myself from a non-admin user.



Thanks all!



P.S. That gs.getSession().isImpersonating() looks like it will come in handy down the line too so thanks for that as well.


View solution in original post

13 REPLIES 13

I'm running Helsinki FYI.


My apologies, I saw ctomasi's post after I submitted mine and deleted it because his code seemed more functional for your purpose...



I'm glad it helped. May the force of Monday be with you.


Doesn't work anymore. Try GlideImpersonate().isImpersonating()

NewUser5
Kilo Contributor

hi nathan ,

 

Actually there are multiple user account.based on some conditions , i want only one account is shown while impersonation.

for this I created onbefore query business rule.

and then check if(GlideImpersonate().isImpersonating()){ 

}

where do i need to include my conditions like vip=false ?

 

Can you please help!