You need to sign in to do that
Don't have an account?
jeff.barnett
Determining user's profile within Trigger
Being new to APEX coding I’m struggling with how to determine the user’s profile in a trigger. I know in VisualForce pages there is $Profile. Is there something similar to that in triggers?
Thanks
Jeff
hey jeff. there are several ways and it depends what you are trying to do. something like
Owner.Profile.Name = 'System Administrator'
in a soql query might work
Yes, there are various ways of knowing the current user's profile.
Simplest , according to me, would be to get the user's profile Id using userinfo.getProfileId() and then query the related profile based on the Id.