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 :
Small and medium business | Business Central, N...
Answered

Simple arithmetic

(0) ShareShare
ReportReport
Posted on by 10

Hello,

Could someone please explain to me how I can perform arithmetical operations in Business Central via AL code?

I have a field of type Decimal called Total, and I wish for this field to show the calculated result of 3 other fields. For example... total = fieldA + fieldB * fieldC.

Please help.

I have the same question (0)
  • KD101 Profile Picture
    45 on at

    Hi, this might not be the answer you're looking for as I'm a pretty novice BC user, but you can type a formula into a cell on BC and it will do the calculation for you, such as 26*10 will give you 260 as the answer in that cell. I don't know how to reference this to specific cells like you would in Excel as A2*B2 but as a temporary work around typing in the values with the calculation would work.

  • Cygnus Profile Picture
    10 on at

    Hi KD101

    Thank you for taking the time to reply. I am using a fixed layout on the card view to present the total field so it is not possible to type directly into it, by design.

    I must be missing something really obvious because it cant be that hard to add 2 fields together.... can it?

  • KD101 Profile Picture
    45 on at

    Calculation-1.png

    Hi Cygnus, I'm not sure to be honest, it's a bit beyond me :-) I've included a couple of screenshots here of how we are doing it. I was told in our training last week by a Microsoft Partner that if you can do something in Excel then you should be able to do it in BC! So it sounds like what you want to do is possible, but I have no idea how, sorry. Hopefully someone else with more technical knowledge will reply on the thread for you

    Calculation-2.png

  • Verified answer
    raelhefn Profile Picture
    on at
  • Cygnus Profile Picture
    10 on at

    Thank you @Raelhefn

    It seems that the answer to my question is to create a custom code unit and have an event subscriber called on a trigger.

    Thank you again

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,917

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,161 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,025 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans