Skip to Content
author's profile photo Former Member
Former Member

ForEach construct in sequential mode, is possible?

Hi,

I would like to know if it is possible to force the foreach construct sequential processing rather than parallel. Or other possible solutions you can take to process invoices in the same order in which they are stored in the file xml input.

The need is to create B1 purchase invoices with the data in an xml file.

The xml file contains several invoices precise order of issue, be loaded on B1 with the same order as in the file xm. If the insertion of an invoice fails, the subsequent should not be imported.

Thank you.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 20, 2012 at 12:50 AM

    Hi Antonio,

    Sorry to inform you that current ForEach only support parallel process.

    Just wondering your scenarios should be managed by transaction, all succeed or none commit if any failure. Not just stop the subsequent process in case of any failure.

    If it is, may you try Company.StartTransaction/EndTransation with B1 function call in B1if to manage the global transaction?

    Kind Regards, Yatsea

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Yatsea,
      my need is to process invoices in the same sequence in which they are in the xml file provided by the branch.

      The xml file contains all the bills one day.
      Invoices must be numered from B1, in the same sequence provided by the subsidiary.

      Is there a way to implement this logic?

      Thank you.
      Sincerely, Antonio.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.