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 :
Small and medium business | Business Central, N...
Answered

Custom Report based on Query with Enum field

(0) ShareShare
ReportReport
Posted on by 1,163

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

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at
    RE: Custom Report based on Query with Enum field

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

  • Anita75 Profile Picture
    1,163 on at
    RE: Custom Report based on Query with Enum field

    I did but see below for error:

    Enum-Status2.png

  • Inge M. Bruvik Profile Picture
    1,105 Moderator on at
    RE: Custom Report based on Query with Enum field

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

  • Anita75 Profile Picture
    1,163 on at
    RE: Custom Report based on Query with Enum field

    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
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at
    RE: Custom Report based on Query with Enum field

    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

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans