You need to sign in to do that
Don't have an account?
sandy k
How to check whether the user have edit access on opportunity using apex code
Hi Guys
How to check whether the user have edit access on opportunity before editing the opportunity using apex code. How can this be implemented using CRUD operation.
How to check whether the user have edit access on opportunity before editing the opportunity using apex code. How can this be implemented using CRUD operation.
To find out if a particular user has Edit access to a record, use the UserRecordAccess object. This object is available in API version 24.0 and later. You can use SOQL to query this object to find out if the user has edit access to the record in question
If you want to check a batch of records you can use
But make sure that allRecordIds is a LIST of IDs. It doesn't work if allRecordIds is a SET of IDs. I guess that's a bug.
Also, only a maximum amount of 200 recordIds can be checked in one query.
Kindly mark it as the best answer if the information was helpful so that it can help others as well.
Regards & Thanks,
Priya Ranjan
If the OP just wants to know if the user has edit authority on the opportunity object itself, that can be done via:
Schema.Opportunity.SObjectType.getDescribe().isCreateable() and Schema.Opportunity.SObjectType.getDescribe().isUpdateable()
Please follow below code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh