web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Multiply a currency field with whole number

(0) ShareShare
ReportReport
Posted on by 65

I have a requirement of multiplying the price field which is a currency data type with the unit which is a whole number data type and store it in another field total amount which is a currency field. 

Tried to use the calculated field but it doesn't support the currency. Can someone help me write a JS to achieve this? 

Many thanks!

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    function calculateamount(executioncontext)

    {
    var formContext=executioncontext.getFormContext();

    var amount = formContext.getAttribute(‘logical name’).getValue();

    var unitvalue=formContext.getAttribute(‘logical name’).getValue();

    var total=amount*unitvalue;

    formContext.getAttribute(‘logical name’).setvalue(total);

    }

  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at

    Hi Prajwal,

    Based on the Microsoft documentation, the calculation field supports currency type.

    https://learn.microsoft.com/en-us/power-apps/maker/data-platform/define-calculated-fields#column-types-that-support-calculations 

    pastedimage1677830551915v1.png

    And i can create the calculated field to get total amount:

    pastedimage1677831071754v2.png

    Test:

    pastedimage1677832261866v3.png

  • Leah Ju Profile Picture
    Microsoft Employee on at

    Hi Partner,

    Have any updates?

    Please feel free to contacts me if you have any questions!

    Could you click 'Yes' under title to close the thread if my answer is helpful!

    Thanks in Advance!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 74

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans