Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

associateRequest does not execute under different user

(0) ShareShare
ReportReport
Posted on by 80

Hi all, I have N:N relationship between new custom entity and Contact 

I am running below code,  when run it from my localhost it create relationship between two records but not when it published and run as a different user. I am a administrative user so i think there should be some privilege issue.

I have given read write and append privilege for this new user on both entities 

OrganizationServiceProxy service = get_org_service();


//add new permission
AssociateRequest req = new AssociateRequest
{
Target = new EntityReference(new_myicpermission.EntityLogicalName, new Guid(uniqeue_id)),
RelatedEntities = new EntityReferenceCollection {
new EntityReference(Contact.EntityLogicalName, new Guid(contactid))
},
Relationship = new Relationship("new_contact_myicpermission")
};


service.Execute(req);


could anyone can help me to resolve this please?

*This post is locked for comments

  • Pathini Profile Picture
    Pathini 80 on at
    RE: associateRequest does not execute under different user

    I've sorted the problem , refreshed the published service and in coding module which i call above code i was passing empty value . anyway thanks for your time.

  • Guido Preite Profile Picture
    Guido Preite 54,069 Super User 2024 Season 1 on at
    RE: associateRequest does not execute under different user

    can you post a screenshot of the security role row for both your custom entity and contact?

    thanks

  • Pathini Profile Picture
    Pathini 80 on at
    RE: associateRequest does not execute under different user

    Org level

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,069 Super User 2024 Season 1 on at
    RE: associateRequest does not execute under different user

    at which level you gave the permissions? if not "organization" maybe the record IDs belong to a different business unit so the user has not the rights to access the record in the first place.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans