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)

Integer Value

(0) ShareShare
ReportReport
Posted on by 3,099

Hi

  I have below code . I want Integer value


IF Customer.GETFILTER("Customer Posting Group") <>'' THEN
 CPG := Customer.GETFILTER("Customer Posting Group")
ELSE
 CPG := '';

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Andrey Baludin Profile Picture
    3,943 on at

    IF Customer.GETFILTER("Customer Posting Group") <>'' THEN

    EVALUATE(CPG, Customer.GETFILTER("Customer Posting Group"))

    ELSE

    CPG := 0;

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      I am getting below erroe

    The Value 'DEB-DE' cannot be evaluated to type Integer

    Thanks

  • Andrey Baludin Profile Picture
    3,943 on at

    I thought that names of Customer Posting Groups are digits-only. So what do you want to transform into integer?

  • Suggested answer
    RockwithNav Profile Picture
    8,941 Super User 2026 Season 1 on at

    How come you can take this DEB-DE into an Integer??

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      In Customer Posting Group it shows like Domestic,Export. I want Index value

    Thanks

  • Suggested answer
    Andrey Baludin Profile Picture
    3,943 on at
    IF Customer.GETFILTER("Customer Posting Group") <>'' THEN BEGIN
    
      CustomerPostingGroup.GET(Customer.GETFILTER("Customer Posting Group"));
      CPG := CustomerPostingGroup.<YourOptionFieldWithIndex>;
    
    END ELSE
    
      CPG := 0;

    where CustomerPostingGroup is record 92. I don't have any option fields there - so it should be a customization. Option converts to integer directly without EVALUATE.

  • Suggested answer
    RockwithNav Profile Picture
    8,941 Super User 2026 Season 1 on at

    It's not a Option Type, so you cant convert it into an integer.

    P.S - Option returns integer only.

  • jsshivalik Profile Picture
    3,099 on at

    Hi

     It has Code DataType.  In a report when User selects filter Customer Posting Group from Customer table then list of Posting Groups is displayed. Can we get its Index value or not.

    Thanks

  • Suggested answer
    RockwithNav Profile Picture
    8,941 Super User 2026 Season 1 on at

    You can get the real value of the posting groups but not in integers obviously.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans