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
resolved after i used ExecuteTransactionRequest
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156