function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Comparing ids of contact owner of contact with user

Hi Team,


Please help me in if condition.


I have contact who became user after approvals no  i am writing one trigger, in that i want to compare id of the user that is submitting the record with this user id.   




Above requirement is not clear, could you please elaborate it in bit more?


I understand that you wish to compare the ID of the contact owner to the current user ID:


Contact.OwnerId will give you the contact Owner ID and UserInfo.getUserId()  will give you the current user ID and you can comapre the two in the IF statement