Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

How to create many-to-many association with oData in CRM 2013

$
0
0

I am writing an import utility to migrate records from a legacy system into CRM 2013 and I am getting stuck trying to assign users to roles using oData. From everwhere I can find documentation to do this, it says I have to do a POST to the SystemUser's set like this:

http://crmServer/orgName/XRMServices/2011/OrganizationData.svc/SystemUserSet(guid'6e6bd6ed-0ffb-e311-84df-005056a72683')/$links/systemuserroles_association

The body of the post contains the role entity to associate with like this: {uri: "http://crmServer/orgName/XRMServices/2011/OrganizationData.svc/RoleSet(guid'd9e7b3b4-4889-e511-b945-005056a70da3')"}

When I run this I get an error: Invalid role specified for entity 'systemuser'in relationship 'systemuserroles_association.Referenced'

Any thoughts on what I could be doing wrong? I verified both the user and role exist.


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>