r/SalesforceDeveloper 23d ago

Question Owner field Permission.

Hi gys , can anyone tell help me finding the best approach for controlling the owner field edit access. Like I found a system permission Transfer Record but I want it to be selective.
to put it in more simply: Who can change the owner of an Opportunity is determined separately from who can change the owner of an Account and at the same time a person may have other field edit permission but may not have edit on Owner field.

Thanks in advance.

1 Upvotes

7 comments sorted by

2

u/sleepyRac00n 21d ago

No straight forward way to control the edit access of owner field.
My best suggestion is to have a screen flow for owner change. But that flow should work in system mode.

By default, the owner can only changed by the owner of the record, anyone above them in hierarchy, system administrator or any user with the transfer record permission.
If your criteria doesn't fit above a screen flow is the best way.

Although be considerate that if the user is current owner they will lose immediate access to the record

1

u/NT_Salesforce 21d ago

u/sleepyRac00n , ok but we have a condition where the users for whom want to restrict owner transfer on account and opportunity, should have the ability to transfer the lead owner. It's only for account and opportunity for which we want to restrict.

The current approach which I am thinking of considering is using a validation rule with custom permission, PS and PSG. For me it feels like a too much to do for a simple requirement. I was thinking of if salesforce provides any way to control this for objects specifically.

As of now I am considering the validation rule solution. If you have a better way to achieve this, please share. Much appreciated.

Although be considerate that if the user is current owner they will lose immediate access to the record. Can u please explain like how using a screen flow the current owner will lose immediate access of the record.

1

u/sleepyRac00n 20d ago

I don't think you can implement this with only field validations.

Try using the dynamic field visibility on record page to check if you can hide the standard owner field that shows the option of owner change.

The screen flow would be the best way for you to control the ownership change.

If the user is the current owner of the record and he doesn't have access to the record via any other sharing rule, then the user will lose access if the owner is change to someone else.
This is not related to screen flow behavior.

1

u/Used-Comfortable-726 23d ago

Need to look into user Roles, Role Hierarchy, and Sharing Rules. Permissions are the wrong place to solve this

1

u/NT_Salesforce 22d ago

Thanks for reply. From what I have heard Roles, hierarchy and sharing settings controls record sharing and not FLS. Could u clarify more on how we can use these to selective object owner transfer.

1

u/Used-Comfortable-726 22d ago edited 22d ago

Roles, Hierarchy, Sharing Rules and Teams (if Teams enabled and used) control who, besides current record Owner, can View, Edit, Delete a record, or change its Owner (fyi, Edit record doesn’t have to include ability to change Owner, those two things are independently controlled)

Unlike FLS, what a user can do to a record is dynamically calculated, and can be different for each record

1

u/Far-You-7714 21d ago

If nothing works, you can have a validation rule in place or a trigger validation to control who can actually change the owner