Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Unexpected returning object format from Xrm.WebApi.online.executeMultiple after plugin throws an InvalidPluginExecutionException

Posted on by 5

I tried to test my request that was made with executeMultiple.
They were normal requests, no change sets.
In my plugin I made a simple random number generator and told it to throw an InvalidPluginExecutionException if a number is smaller than 3.
In the official docs I believe it says that if one of the requests in a batch of request fails, in the response object it will show as "ok: false", and I should get back all the responses for the other requests as well. 
I only got back the single error message, and no other info.
In the networks tab, in the reponse I can see that some passed, and one fails, and after that nothing is executed, and it returns with "Bad Request 400" status.
I'd really need the data which ones pass and which ones don't (in my code, not for my eyes to see in the tab).
What should I do?

Normal reponse object:

normal-object.png

Custom error I get:

custom-error.png

Network tab:

custom-error-network.jpg

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Unexpected returning object format from Xrm.WebApi.online.executeMultiple after plugin throws an InvalidPluginExecutionException

    Hi,

    Can you please share your code which you have used?

    Also as per Microsoft DOC you should get array of object in response with below attributes.

    successCallback Function No

    A function to call when operation is executed successfully. An array of response objects are passed to the function where each response object has the following attributes:

    body: (Optional). Object. Response body.

    headers: Object. Response headers.

    ok: Boolean. Indicates whether the request was successful.

    status: Number. Numeric value in the response status code. For example: 200

    statusText: String. Description of the response status code. For example: OK

    type: String. Response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text".

    url: String. Request URL of the action, function, or CRUD request that was sent to the Web API endpoint.

    If found helpful, Please mark my answer verified.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans