In CRM 2015 SDK when you are using OrgService.Associate (wrapped in try/catch) to associate an EntityReferenceCollection to an Entity, if any one of the EntityReferences fails, does the entire ERC fail at that point? Or say there were 10 ERs in the ERC and the 7th one failed, do the first 6 succeed and then the subsequent 4 are not processed? Or do all 10 in ERC get processed and associate except just that #7 that failed?
Does this make sense?
The Associate message is processed in a single transaction, so if any of the related entities fails the entire transaction is rolled back.
You can easily test it executing the following code:
This will end up in a FaultException being thrown:
And you will be able to check that no associations were created for account #1 and #3.