web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

Purchase Order Line workflow - reject total order

(0) ShareShare
ReportReport
Posted on by 295

We have the following scenario...

Create a purchase order with two lines, first line is for a regular stock item, second line is for a procurement category (not stock).

Need to create a workflow to reject the total order if one of the PO lines is a procurement category, our PO's should be stock or non stock and not mixed..

07_2D00_09_2D00_2016-14_2D00_32_2D00_23.png

If we just use PO header workflow, AX looks at one line (not both) and depending if the first line is stock or procurement category makes a decision.

Have tried to create a PO line level workflow, and it detects if one line is a procurement category or not. - Correct

We set the PO line workflow to approve the PO line if it is a stock item or reject PO line if procurement category.

The idea was that if a line is rejected, the header would also be rejected, but it doesn't work...

When the workflow runs:- if the line is for a stock item the line approves and the workflow control returns to the PO header workflow. - Correct

 if the line is procurement category the line rejects but the workflow does not return to the PO header workflow, the PO line workflow sits in a pending state! - Not correct

Any other ideas how to build a workflow to allow this level of control?

*This post is locked for comments

I have the same question (0)
  • DeadmanWNC Profile Picture
    295 on at
    RE: AX2012 Purchase Order Line workflow - reject total order

    Any ideas? Can it be done or do we have to put a business process in place to manually check the orders?

  • Community Member Profile Picture
    on at
    RE: AX2012 Purchase Order Line workflow - reject total order

    The reason this won't work is because one line has been rejected and one has been approved, we had a similar issue.

    If this is all automated, from what I understand it is, you should try 'Invoke a workflow for each line' rather than invoke single workflow for all lines. You should then add a node into the workflow which says if purchase order lines.state = returned then auto Reject. This should allow the whole PO to reject and return to the header workflow.

    Give this a try.

  • DeadmanWNC Profile Picture
    295 on at
    RE: Purchase Order Line workflow - reject total order

    Hi Bruce,

    Thanks for the reply, not sure I get what you mean?

    I know how to start a separate line level workflow for each line of the PO that's not an issue, but what do I put in the line level workflow?

    I need to compare all lines of the PO and make sure that every line is either a stock item or every line is a procurement category.

  • Community Member Profile Picture
    on at
    RE: Purchase Order Line workflow - reject total order

    Hi Deadman,

    I would suggest using the procurement category as a conditional decision, this is without knowing your procurement category setup.

    Where procurement category = 'stock' or where procurement category = 'non-stock'. Again, without knowing the setup of your system it's hard to pinpoint exactly how to write the workflow. Others may have another suggestion.

  • DeadmanWNC Profile Picture
    295 on at
    RE: Purchase Order Line workflow - reject total order

    Thanks a lot for the help, but its not that simple it never is :-)

    We can have some PO lines that have a procurement category and some PO lines without a procurement category, which is fine and correct.

    The issue is if we have one PO where the lines are mixed, i.e. one line with a category and one line without a category on the same PO. If the lines are mixed we need to reject the total order and make the users remove lines from the PO to make them the same type.

    But I still don't understand what the workflow will do...

    Start a PO header workflow, that will start two line level workflows.

    What do I put in the line level workflows? I can detect if they have a procurement category or not but how do I compare the different PO lines against each other?

  • DeadmanWNC Profile Picture
    295 on at
    RE: Purchase Order Line workflow - reject total order

    With another diagram !

    Drawing1.jpg

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Purchase Order Line workflow - reject total order

    Conditional-Dee.PNGConditional-Dee.PNGcond-dec.PNG

    Sorry I misunderstood the scenario. Based on what you've setup above would these attached screenshots satisfy the requirement?

    The conditional decision is evaluating on the line number and the procurement category, you could replicate this as many times as required. 

  • Suggested answer
    DeadmanWNC Profile Picture
    295 on at
    RE: Purchase Order Line workflow - reject total order

    Morning Bruce.

    I will mark your suggestion as an answer as it would work with the caveat that if the PO originally contained lines 1,2 and 3, then a user deletes line 2, the logic would be difficult to create to compare lines 1 & 3 etc...

    Have found an alternative way to solve this issue...

    We will add two additional calculated totals to the PO header; total of procurement category lines and total of non-procurement category lines.

    Then use logic to compare these two new fields to the total PO value and if they don't match the PO must contain mixed lines so reject the PO.

  • Community Member Profile Picture
    on at
    RE: Purchase Order Line workflow - reject total order

    Nice customization idea!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans