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

Announcements

No record found.

News and Announcements icon
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.

  • 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
    Microsoft Employee 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 740 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 531 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 310 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans