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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Custom Report based on Query with Enum field

(0) ShareShare
ReportReport
Posted on by 1,165

Hi All,

I have created a RDLC report using data from Query Object - this is for purchase orders.  One of the fields (Status) is an Enum field and it shows 1,2,3 etc when the report is run.

Variable depclaration in VSC is below:

Enum-Status.png

I do not know how to declare Status as a variable and what's the best way show front end values for each statuses.  If I run the query without a report it shows purchase order status such as Open, Release etc

Thanks

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    Have you tried  to declear it like "Staus : Enum Status;"?

  • Anita75 Profile Picture
    1,165 on at

    I did but see below for error:

    Enum-Status2.png

  • IB-29041624-0 Profile Picture
    1,191 Moderator on at

    Then you do not have the Enum status defined in your scope.  Can you share the complete code?

  • Anita75 Profile Picture
    1,165 on at

    Ok had another go and found out that with ENUM fields you have to use the original field name from table rather than given name .

    Status: ENUM "Purchase Document Status";

    This of course is different to other fields and have no idea why this has be complicated and why ENUM fields are there in the first place.

    That said if i want to change the front end names for each ENUM integer value like 0,1,2 then i can use a case statement so perhaps there are other advantages

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    I think the big advantage of the ENUMs are that they are extendable in a better way than the old option fields. So if you develope extentions to Business Central the use of ENUMs makes more sense.

    docs.microsoft.com/.../devenv-extensible-enums

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 715 Super User 2026 Season 2

#2
AndrewThomas81 Profile Picture

AndrewThomas81 390 Super User 2026 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 386 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans