Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Posting PO in a Batchjob

Posted on by 15

Hi Guys,

When I post PO from a batch job (in Ax2009), records are getting created in PurchParmTable.  As I use Late selection it generates records and shows them in the posting dialog. It holds the records after the completion of the transaction.  This gives problem during the next batch transaction if it found records in the posting dialog.   How could if remove records from this posting dialog(ParchParmTable) after the completion of the posting process?

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,214 Most Valuable Professional on at
    RE: Posting PO in a Batchjob

    That's not how it should work, AFAIK. How exactly did you set it up? Isn't the batch job a customization?

  • Nadeem ahmad Profile Picture
    Nadeem ahmad 15 on at
    RE: Posting PO in a Batchjob

    Hi André,

    A parmid is defined when I create PO posting batch job, this parmid is fixed and used for each iteration for this batchjob.
    I want to remove processed records from PurchParmTable. I want to know a place where I can put my delete code.
    I tried to delete records in run/mainOnServer methods of PurchFormLetetr classes.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: Posting PO in a Batchjob

    Hi Nadeem,

    Can you tell which exact parm ID is used/created? Can you verify the System number sequence? It should not be set to continuous.

  • Nadeem ahmad Profile Picture
    Nadeem ahmad 15 on at
    RE: Posting PO in a Batchjob

    Hi  André Arnaud ,

    The first iteration finished after posting the PO and by saving a record for this PO in the PurchParmTable. The second iteration takes the same ParmID and tries to post the previously posted PO.

    2nd iteration works fine if I remove the record from the PurchParmTable.  Do it required a new ParmId to resolve this issue?  where should I can create a new ParmId?

    I'm thinking to remove the record from the PurchParmTable. in that case, I want to know in which class or method I can do it.

    Thank you in advance.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: Posting PO in a Batchjob

    Hi Nadeem,

    Late selection means that during the batch run, it will try to find all purchase orders which meets the criteria. Why is a second batch transaction already running? Can you explain the scenario?

  • Nadeem ahmad Profile Picture
    Nadeem ahmad 15 on at
    RE: Posting PO in a Batchjob

    Hi Martin.

    Thanks for your prompt response. I could see ParmID is not going to change in any iteration. it is fixed although I have select the late selection in my query select form. What went wrong? where can I make it changeable for every iteration when it is the late selection?

    Thanks

  • Martin Dráb Profile Picture
    Martin Dráb 230,214 Most Valuable Professional on at
    RE: Posting PO in a Batchjob

    The next posting should have a different ParmId and therefore records for the previous posting shouldn't be used for the new one. Do you agree?

    Are you sure that your query (used for late selection) filters out records that we're already posted?

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