Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

want to calculate the percentage  using x++

Posted on by 138

4010.Capturenew.PNG

I have

field  (Gross Pay)

field   (Percentage)  

field  (Amount)

I want to calculate the percentage in c= a*b/100

store value in the field Amount

  • zyir Profile Picture
    zyir 138 on at
    RE: want to calculate the percentage  using x++

    Yes, I didn't know how t refer to the table field.

    Thank you @Martin Dráb for the help, problem solved.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: want to calculate the percentage  using x++

    Fine, but what's the problem? It's difficult to address your problem if you don't tell us what it is.

    The mathematical operators in X are exactly the same as in your example, therefore c= a*b/100 is actually valid X code.

    Does it mean that you don't know how to refer to a table field? It's simple - you need a variable containing a table buffer, then a dot ('.') and then a field name. For example:

    this.Amount = this.GrossPay * this.Percentage / 100;

  • zyir Profile Picture
    zyir 138 on at
    RE: want to calculate the percentage  using x++

    No, I haven't got a fix yet,

    I will be glad if anyone can help out.

    Thanks in advance.

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: want to calculate the percentage  using x++

    Does it mean that you've already solved the problem by yourself?

    If not, please tell us what problem you have with the implementation.

  • zyir Profile Picture
    zyir 138 on at
    RE: want to calculate the percentage  using x++

    Thank You for the Help

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: want to calculate the percentage  using x++

    All right, and what's the problem?

    By the way, I've moved your question from Dynamics AX Forum to Dynamics 365 Finance Forum and changed the category from Administration and Setup to Development / Customization / SDK. Please pay more attention to it next time.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans