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
Miya PMiya P 

Pls help on Restrictions on Lead owner change:

I have the following requirment, pls post your ideas on how should I implement this:

Only Lead owner should be able to  move  the lead out from their name & manager should be able to move only his/her teams leads.

--> owner of the record can only change the Lead owner field
--> And Managers can change the lead owner only for the records which are owned by his/ her team

How to acheive this ?
Syed Insha Jawaid 2Syed Insha Jawaid 2
Hi Miya

What is the OWD of lead?
If it private and with Grant User Hierrachy then it woul be viewable only to the owner and his managers in role hierarchy.

If thats not the case then : Do the immediate managers only have the right ot change the owner or people higher in hierarchy aslo?

Cheers !!!
Raj VakatiRaj Vakati
You can able to do it with validation with out changing OWD

here is the validation rule 
 
AND(
ISCHANGED(OwnerId ) , 
OR(
OwnerId <>  $User.Id  , 
 Owner:User.Manager.Id <>$User.Id 
)
)

 
Miya PMiya P
Hi syed,

OWD on Lead is set to Public Read/Write/Transfer & Grant acess using hierarchy is TRUE.
Could you suggest me how do I chnage that in order to satisfy my requirment ?

We want people higher in hierarchy also to make chnage to the lead owner field.


Thank you!

 
Miya PMiya P
Hi Raj,
Validation rule didnot not work for manager level acess, 
I logged in as one of the manager and tried to change the lead owner  of his teams lead record and it throwed the error.

Formula I used:
AND( 
ISCHANGED(OwnerId ), 
$Profile.Name <> 'System Administrator', 
PRIORVALUE(OwnerId) <> $User.Id, 
Owner:User.Manager.Id <>$User.Id 
)

This formula worked fine with the owner level, but I'm not sure why its not working with manager level. Could you pls guide on this ?

Thank you!
 
Miya PMiya P
Hi Raj, 

The above formula is working, when I logged in as Manager and pick own of the manager teams lead record and if I change the owner to some one under the manager (working fine amounf the mnagers team only).
But here, I want the managers to assign his teams leads to any  other user (person he is assigning to many not be under him)

Please let me know if this can be done.

 
Raj VakatiRaj Vakati
Try this 
 
AND( 
ISCHANGED(OwnerId ), 
$Profile.Name <> 'System Administrator', 
PRIORVALUE(OwnerId) <> $User.Id, 
OwnerId <>$User.Id  

)

 
Miya PMiya P
Hi Raj,

This did not work, I think it is making the rule more stricter.