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.
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..
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.
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:
Hi I meant the following status.
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?
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Sohaib Cheema 789 User Group Leader
André Arnaud de Cal... 607 Super User 2025 Season 2
Martin Dráb 497 Most Valuable Professional