
Announcements
Hi
Using the organization service, it is possible to update child entities as an aggregate request, per -
Now, I am reading that the organization service endpoint may not be supported directly in future and the Web API is the preferred approach.
How can the above capability be achieved using the REST APIs?
I have have faced limitations with the REST API noted here-
Hi @Anonymous,
Yes it's possible with the OrganizationService. And note that is not set to be deprecated anytime soon. It is actually the widely used for extending Dataverse. To acheive this there are two methods:
var accountToUpdate = new Account
{
Name = "Example Account - Updated",
AccountId = _accountId
};
var relatedLettersToUpdate = new EntityCollection
{
EntityName = Letter.EntityLogicalName,
Entities =
{
new Letter{Subject = "Letter 1 - Updated", ActivityId = _letterIds[0]},
new Letter{Subject = "Letter 2 - Updated", ActivityId = _letterIds[1]},
new Letter{Subject = "Letter 3 - Updated", ActivityId = _letterIds[2]}
}
};
accountToUpdate.RelatedEntities.Add(letterRelationship, relatedLettersToUpdate);
service.Update(accountToUpdate);
BTW with your post in the other thread concernig Web API, did you give Batch requests a try? That will work 🙂
Hope this helps!