web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at

    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

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    6,211 on at

    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

  • Community Member Profile Picture
    on at

    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
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi ,

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

  • Shahbaaz Ansari Profile Picture
    6,211 on at

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

  • Community Member Profile Picture
    on at

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

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    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

  • Community Member Profile Picture
    on at

    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!!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans