locked
Workflow to update status one at a time? RRS feed

  • Question

  • Hello,

    We have an async plugin that pushes an order to the credit card gateway (when an order is Fulfilled.)  The plugin fires when the user clicks Fulfill Order and pushes the one transaction to the cc  gateway.   It updates the order record accordingly - in case the transaction fails or is rejected.

    Now, we have to handle batch jobs - and I'm trying to think of a clean and easy way.  I thought I could write a simple workflow to update the status of selected orders to Fulfill - Completed.   But it looks like that will update all selected orders at the same time, and I'm concerned it will push all selected orders at once.   If we have a batch of orders to go (300+) the gateway will likely not accept all transactions at once.

    How would you design this to insure successful transmission of these transactions to the gateway?

    Can a workflow be written to loop through the selected records, and wait for a response for each before proceeding?

    Tuesday, June 11, 2013 9:33 PM

Answers

  • I don't see an easy way to do this. Are you sure the gateway can't cope with this load - it doesn't seem too heavy a load, and the requests will be slightly staggered as the orders will be fulfilled sequentially

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by Richard Magee Wednesday, June 12, 2013 7:48 PM
    Wednesday, June 12, 2013 8:14 AM
    Moderator

All replies

  • I don't see an easy way to do this. Are you sure the gateway can't cope with this load - it doesn't seem too heavy a load, and the requests will be slightly staggered as the orders will be fulfilled sequentially

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by Richard Magee Wednesday, June 12, 2013 7:48 PM
    Wednesday, June 12, 2013 8:14 AM
    Moderator
  • Why don't you make a service, call it from javascript or server code (when you talk about selected records, I assume you use grid view. Use ribbon button to call javascript with built in parameter which sends array of selected ids)? The service can process one order at time.

    Zarko

    Wednesday, June 12, 2013 10:21 AM