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

what's wrong with this associate call?

$
0
0

Hello, any idea what might be wrong with the associate call in the following method?:

public void AssociateParentChild(IOrganizationService orgService, Guid parentIncidentId)
{
//hard-coded guid for test purposes
var child = orgService.Retrieve("incident", new Guid("FC48CDB2-8C25-E311-B7DA-00155D760004"), new ColumnSet(true));
var relatedEntities = new EntityReferenceCollection();
relatedEntities.Add(child.ToEntityReference());
orgService.Associate("incident", parentIncidentId,
new Relationship("new_incident_incident_Parent") { PrimaryEntityRole = EntityRole.Referenced }, relatedEntities);
}

I've validated that the guids used for this method are valid. The relationship name used in the associate call is correct. However, the associate
call returns the following error:

Value cannot be null.

Parameter name: source

Any idea what the issue might be here?


Viewing all articles
Browse latest Browse all 79901

Trending Articles



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