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
shabu_thomasshabu_thomas 

Urgent: Delete Permission to Custom Objects without Edit Permission

Hi,

 

By default, if we can't implement delete permission alone without edit permission to a custom object.

But, in our case, a user can create or delete a record. But he should not edit it.

 

How can we implement it ?

 

Always welcome an immediate answer

 

Rgds

Shabu

aalbertaalbert

You could override the standard Delete button with a Visualforce page. And that simple Visualforce page calls an Apex controller that performs the Delete. Apex can run as System Administrator context and therefore execute the Delete - even though the logged in user's Profile might not grant that CRUD permission.

 

 

shabu_thomasshabu_thomas
Thanks. I agree. But, is there any way to give both edit and delete permission and remove edit link from all related list records, so that we can prevent editing by clicking the edit link in related list ?
paynecpaynec

Assuming you are on EE or UE.  The "delete" permission on a custom object can't be granted to a custom profile without having the edit rights as well.  And the function links "Edit|Del" on a related list will appear based on the profile's rights, so aside from some heavy Visualforce overrides or something, you're stuck there too.

 

Could you use field-level security to mark the fields read only or not visible to the standard user profile (be it Standard User or a custom profile you've created)?  That way you could still give them access to delete the record but they wouldn't be able to make other changes?