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...
Unanswered

Salesdocument: use parameter to calculate quantity

(0) ShareShare
ReportReport
Posted on by 487

Hello Everyone,

I am trying to do something a bit complicated in my sales document, and having a lot of trouble making it work.

To know my quantity, the user inputs a number in a custom field (lets call it "amount"). I have an onModify code block that will take that amount, do some stuff with it, and take the resulting value and assign it to quantity. A decimal number.

Now, I started by having the user input the value in the quantity field, and put the real amount in the custom field, and multiply it with my unit price. This had the following issues:

- cannot calculate totals for the document

- issues with discounts

- plenty other issues i encountered

I tried another approach, the one cited before. I have the user fill in a custom field called amount, and put the correct decimal in quantity. But this also gives a lot of issues for BC.

- line amounts are not always being calculated

- document totals are not being calculated, or only sometimes

- other inconsistencies

The thing is, I also have automated lines where the amounts are calculated automatically (sum of other lines, etc).

I really feel like this is not the right approach for my quantities, and as long as those are not right, I will be stuck with my other "parts", like the automatically calculated lines, etc.

Can you guys give some input/ideas please?

Cheers

I have the same question (0)

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