Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Need to give permission to the user who selected in a Record's User Look UP Field

(1) ShareShare
ReportReport
Posted on by

Hi,

The owning user for the record only have the edit/assign permission to that record. I need to give edit/assign permission to the user who has selected in User Look Up field. Initially he doesn't have those rights.


Thanks,

Manikandan.

*This post is locked for comments

  • RE: Need to give permission to the user who selected in a Record's User Look UP Field

    Thanks Wei Jie Fun!!

    I have done this with "Share" feature using "Custom Workflow".

    Shahbaaz Ansari ,Pravin and Wei Jie Fun thanks for your Answers.

    Thanks Again!!

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Need to give permission to the user who selected in a Record's User Look UP Field

    Hi,

    use access team or record shared feature if the user lookup is not owner field.

    Access team

    msdn.microsoft.com/.../dn932132.aspx

    Share record

    msdn.microsoft.com/.../hh547423.aspx

  • RE: Need to give permission to the user who selected in a Record's User Look UP Field

    I want that role assigned user to edit/assign that only record instead of all other records. is that possible?

  • Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,205 on at
    RE: Need to give permission to the user who selected in a Record's User Look UP Field

    Yes that is true, that will be for entity not record based.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Need to give permission to the user who selected in a Record's User Look UP Field

    Hi ,

     if the security role is working based on the  privilege is given. So, it is entity based instead of record based.

  • RE: Need to give permission to the user who selected in a Record's User Look UP Field

    Hi Shahbaaz Ansari,

    If i assign security role to the user he can edit/assign all records belongs to the entity not only the particular record right?

    I want him to edit/assign that only record instead of all other records. is that possible?

    Thanks,

    Mani.

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,205 on at
    RE: Need to give permission to the user who selected in a Record's User Look UP Field

    Hi Manikandan,

    You can achieve it by plugin, Lets say You have User A, which you selected in Lookup for a record, when you save that record, create a plugin which will be on Create Message, Async method on your entity.

    Note : You need to created a new security role which will be having edit/assign security access on that entity, pass the user id which you will get from context and security role id, that you can get by using QueryExpression or for testing you can pass static guid which you can get from URL when you open that security role.

    Below is the code,

    AssociateRequest ar = new AssociateRequest();

    ar.RelatedEntities = new EntityReferenceCollection();

    ar.RelatedEntities.Add(new EntityReference("systemuser", newuserid));

    ar.Relationship = new Relationship("systemuserroles_association");

    ar.Target = new EntityReference("role", roleid);

    service.Execute(ar);

    Refer : ashwaniashwin.wordpress.com/.../plugin-code-to-assign-roles-to-users-in-microsoft-dynamics-crm-2011

    If you find it helpful, Please mark as Verified.

    Best Regards,

    Shahbaaz

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,231 on at
    RE: Need to give permission to the user who selected in a Record's User Look UP Field

    Hi Manikandan,

    Please look into this blog once, it could be helpful for you.

    debajmecrm.com/.../dynamics-crm-programatically-assign-privilege-to-security-role-for-an-entity-in-mscrm

    Regards,

    Pravin

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans