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 :
Finance | Project Operations, Human Resources, ...
Suggested answer

How to find enum of Purchase Line status?

(0) ShareShare
ReportReport
Posted on by 676

Hi,

I see that each PO line can have line status of Open order, Canceled and so on.

But I cannot find the enum of this field in AOT.

If I want to find the value of this from a PurchLine record and use it in the if clause,

What should I do?

Thank you.

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    235,961 Most Valuable Professional on at
    RE: How to find enum of Purchase Line status?

    All right, if you know how to do, you now surely agree with me that it's from PurchTable, not PurchLine, the field is PurchStatus and the enum PurchStatus.

    The only problem seems to be that you're looking for an enum element called "Open order" and there is none. First of all, notice that it can't ever exist - element names cannnot contain spaces. "Open order" is actually a label; it has different values in different languages. The element with this label is PurchStatus::Backorder; the label ID is @SYS78505. Notice that I used Backorder in my code sample above.

    If you're not familiar with the concept of labels, look into it, because it's very important..

  • ShawnDEV Profile Picture
    676 on at
    RE: How to find enum of Purchase Line status?

    Hi,

    I am actually aware of that search.

    However, the Enum type of Data Field = PurchStatus from PurchTable table is also set to PurchStatus which does not have a literal of Open order or Cancelled.

    That's why I am asking how to find it.

    Thank you.

  • Suggested answer
    Martin Dráb Profile Picture
    235,961 Most Valuable Professional on at
    RE: How to find enum of Purchase Line status?

    In this case, your problem is in your wrong expectations. Status_PurchStatus control in PurchLineOpenOrder isn't bound to PurchLine at all. It comes from PurchTable.

    Let me teach one way how you can find it by yourself:

    1. You know the name of the form, therefore find it Applicatin Explorer. You can simply put PurchLineOpenOrder (or ^PurchLineOpenOrder$) to the serch box on the top.
    2. Open the form in designer.
    3. You know the name of the control - find it by putting to the name (Status_PurchStatus) to the search box on the top of the designer.
    4. Highlight the control and look at properties.
    5. You'll seem that Data Source = PurchTable and Data Field = PurchStatus.
  • ShawnDEV Profile Picture
    676 on at
    RE: How to find enum of Purchase Line status?

    Hi I meant the following status.

    1070.screenshot.png

    it is from the Form control (status_PurchStatus) in the form PurchLineOpenOrder.

    I want to find this status value from a table buffer in if clause. 

    How can we write a code for this? 

    Thank you. 

  • Suggested answer
    Martin Dráb Profile Picture
    235,961 Most Valuable Professional on at
    RE: How to find enum of Purchase Line status?

    It's PurchLine.PurchStatus field, enum PurchStatus.

    Using it is trivial:

    if (purchLine.PurchStatus == PurchStatus::Backorder)

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 789 User Group Leader

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 607 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 497 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans