Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Integer Value

Posted on by 3,027

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

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: Integer Value

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

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Integer Value

    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
    RockwithNav 6,562 on at
    RE: Integer Value

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

    P.S - Option returns integer only.

  • Suggested answer
    Andrey Baludin Profile Picture
    Andrey Baludin 3,941 on at
    RE: Integer Value
    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.

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Integer Value

    Hi

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

    Thanks

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: Integer Value

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

  • Andrey Baludin Profile Picture
    Andrey Baludin 3,941 on at
    RE: Integer Value

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

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Integer Value

    Hi

      I am getting below erroe

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

    Thanks

  • Suggested answer
    Andrey Baludin Profile Picture
    Andrey Baludin 3,941 on at
    RE: Integer Value

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

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

    ELSE

    CPG := 0;

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans