[SalesForce] make Account Owner read only

This is my issue

Users assigned to a particular profile who cannot change the account owner.

I went into the profile to set OwnerId to readonly and cant do it at profile level for some reason.

The other way i used was to go to the object account > Account Owner > set field level security which i cant

So i opted to write validation rule

AND ( ISCHANGED( OwnerId), 

RecordType.Id = "000D0000000xxxx",

RecordType.Id = "000D0000000xxxx", 

$Profile.Id <>'000D0000000xxxx')

This is not working as well. can anyone suggest me how can i assign readonly permission on a single profile

Thanks In advance

Best Answer

You can make the Account Owner field as Read only in the page layout assigned to those profiles.

enter image description here

But the recommended approach is to use a validation rule, like this:

AND ( 
  ISCHANGED( OwnerId), 
  OR(
    RecordType.Id = "000D0000000xxxx",
    RecordType.Id = "000D0000000xxxx" 
  ),
  $Profile.Id <>'000D0000000xxxx'
)

Because then even if the user triggers the change through the API, for example, the platform will validate this change. Doing the "lock" just on the page layout does not prevent this.

Related Topic