Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

How to get the real value of macro?

Posted on by 1,548

Hi,

How to get the value macros inside TradeTotals class

    public static Integer  posCurrency()
    {
        return #posCurrency;
    }

I want to call TradeTotals::pocCurrency and get GBP instead of integer number.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: How to get the real value of macro?

    [tag:posCurrency] is an integer and posCurrency method will always return that integer. There's no way how you could call TradeTotals::posCurrency and get the currency code.

    But, if your actual requirement is something else, perhaps we can help you solve it.

    If you look at that class in detail, you will notice that [tag:posCurrency] is used to control the position of the actual currency info in the displayFields container.

    So, if you use [tag:posCurrency] to lookup a value from displayFields (with conPeek function) you will get the actual currency code.

    Please let us know if this helps to solve your actual requirement. Thanks!

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,417 on at
    RE: How to get the real value of macro?

    Hi junior AX,

    posCurrency macro has been defined in the class with integer 8 and is being used to identify the position of the currency field in a container.

    pastedimage1613570372188v1.png

    You can find the currency code value using conPeek. Please check currencyCodeValue method in PurchTotalsForm class as an example.

    pastedimage1613570510159v2.png

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans