I need to disable the ability to change a record owner, but only for the Lead object, and only for one Profile. Is this possible?
Alternatively/Additionally, is there a way to remove the "change owner" button from the mobile app?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Should they be able to edit the record at all? If not, you could simply remove the
edit ability for that object for that one profile.
Otherwise, a validation rule should work well. You can specify the conditions you'd like:
anytime the Owner field changes AND it's the profile you're stopping
In actual, correct syntax
AND( ISCHANGED(OwnerId), $Profile.Id = '' //insert profile Id here )
To avoid hard-coding the ID, you can use a couple different options:
AND( ISCHANGED(OwnerId), $Profile.Name = '' //insert profile name here )
AND( ISCHANGED(OwnerId), $Permission.Prevent_Lead_Owner_Edit) )
AND( ISCHANGED(OwnerId), $User.ProfileName = $CustomMetadata.Profile_Mapping__mdt.YourProfileName )
For the button on the mobile app, you should be able to remove the action from the page layout for that object if the profile has its own layout.