web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

ExecuteMultipleRequest object not working with OrganizationService execute method

(0) ShareShare
ReportReport
Posted on by

I am targeting a CRM 2013 on-premise installation with a .NET executable reading/writing data through the OrganizationService.  The OrganizationService works; I was able to test it by creating a new account and the new account showed up in CRM.

But, when I try to use the ExecuteMultipleRequest I get the following error: "There was an error while trying to serialize parameter schemas.microsoft.com/.../Services:request. The InnerException message was 'Type 'Microsoft.Xrm.Sdk.Messages.ExecuteMultipleRequest' with data contract name 'ExecuteMultipleRequest:schemas.microsoft.com/.../Contracts' is not expected."

I understand a bit that this has something to do with the type ExecuteMultipleRequest not being an expected object by the OrganizationService.  But how do I fix it?  I would have thought that this would have been a part of the WSDL used to set up the OrganizationService reference in Visual Studio.

Also, a side question: if I attempt to use early bound entities through the OrganizationServiceClient, I get a similar error for the entity object I am trying to create.  e.g.:  client.Create(new Account { name = "Test Account 002" };  This will then tell me that the Account object is not expected.  Is there also a way to set up the OrganizationService to be able to use early bound types?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi,

    Execute is the correct method to use with ExecuteMultipleRequest. I think the issue is with what you're setting on the Requests property. It's expecting a series of requests like UpdateRequest, CreateRequest or DeleteRequest, and those requests need to have all the expected values and types. I don't use the early bound types (not a fan), but I'm pretty sure you need to be using the late-bound Entity for the requests. I'd start by verifying the ExecuteMultipleRequest works with a simple delete since that takes the least parameters, and that'll show that you're using the right methods but your parameters need to be updated.

    Hope this helps! I'd appreciate if you'd mark this as Answering your question.

    Thanks,

     Aiden

  • Community Member Profile Picture
    on at

    If I change the ExecuteMultipleRequest to contain a single DeleteRequest I get the exact same error that ExecuteMultipleRequest is not expected.

    Also, if I execute only the DeleteRequest like this:  client.Execute(new DeleteRequest { Target = new EntityReference("account", new Guid("29563E29-E921-E611-810B-005056987BFB")) });  Then I get a similar message that DeleteRequest is not expected.

  • NatrajY Profile Picture
    3,040 on at

    Are you setting the request property correct? Please refer https://msdn.microsoft.com/en-au/library/jj863631.aspx and confirm that you are doing this correctly. You would only get a serializableexception, if you are not setting some value incorrectly. Are you trying to do a ExecuteMultiple of ExecuteMultiples?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans