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 :
Microsoft Dynamics NAV (Archived)

Option Field

(0) ShareShare
ReportReport
Posted on by 3,099

Hi

  I have an Option Type field . I want to gets its value not 0,1,2 in variable.

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,204 Super User 2026 Season 1 on at

    can you show your code and what type of dataitems they are etc.?

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      Below is the code. Category is an option type variable

     PLine.RESET;

     PLine.SETRANGE("Lot No","Lot No");

     IF PLine.FINDFIRST THEN BEGIN

       Category := PLine.Type;

     END;

    When i give Category as Text then it gives error

    Text := option error

    Thanks

  • Suggested answer
    Mohana Yadav Profile Picture
    61,204 Super User 2026 Season 1 on at

    did you give OptionString property to variable Category?

  • jsshivalik Profile Picture
    3,099 on at

    Hi

     In tables i have defined Category with Options Export,Import,Domestic.

    I want to get this values saved in a variable

    Thanks

  • Suggested answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    You need to declare the variable as Option and set the same option string as you have specified in the table.  Then you can assign the value.

  • jsshivalik Profile Picture
    3,099 on at

    Hi

     I have defined the variable as option . When i display as message it shows correctly but in SSRS it shows 1,2. Those records which have value 0 in Type in Report it does not show

    Can u show some example

    Thanks

  • Suggested answer
    Mohana Yadav Profile Picture
    61,204 Super User 2026 Season 1 on at

    Did you try FORMAT(optiontype)?

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      I have defined now variable as Integer. It is working now but it is not displaying Option string value . It is showing 0,1,2

    Thanks

  • jsshivalik Profile Picture
    3,099 on at

    Hi

     After defining variable as Text and then using Category := Format(PLine.Type).

    Then it is showing Option String . Is this the correct way.

    Thanks

  • Verified answer
    Mohana Yadav Profile Picture
    61,204 Super User 2026 Season 1 on at

    yes

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans