Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

ExecuteMultipleRequest not working within custom workflow called by Custom Action?

Posted on by 2,715

Hello All,

               I am finding a strange behavior,i am calling an action from custom button on click,inside the action  i am calling a custom workflow activity .In  custom workflow activity i am using ExecuteMultipleRequest  for updating the entity records.ExecuteMultipleRequest   is only working only when i am debugging m code,but its not working once i removed my debugger.below is the code that i have used for  ExecuteMultipleRequest   

public static void BulkUpdate(IOrganizationService orgService, ITracingService tracingService, EntityCollection entities)
{
// Create an ExecuteMultipleRequest object.
var multipleRequest = new ExecuteMultipleRequest()
{
// Assign settings that define execution behavior: continue on error, return responses.
Settings = new ExecuteMultipleSettings()
{
ContinueOnError = false,
ReturnResponses = false
},
// Create an empty organization request collection.
Requests = new OrganizationRequestCollection()
};
// Add a CreateRequest for each entity to the request collection.
foreach (var entity in entities.Entities)
{
UpdateRequest updateRequest = new UpdateRequest { Target = entity };
multipleRequest.Requests.Add(updateRequest);
}
// Execute all the requests in the request collection using a single web method call.
ExecuteMultipleResponse multipleResponse = (ExecuteMultipleResponse)orgService.Execute(multipleRequest);
}

*This post is locked for comments

  • Verified answer
    Ramakanta Profile Picture
    Ramakanta 2,715 on at
    RE: ExecuteMultipleRequest not working within custom workflow called by Custom Action?

    resolved after i used ExecuteTransactionRequest

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans