hi to all,
I have a little problem here...
I am working with a form 42 Sales Order and I would like to add one field in the header which will show me the Invoice Amount (don't need in the table).
When I enter the Sales line, line by line, the new created field should be filled with the sum of all lines.
The field "Amount Including VAT" is not of use to me because it will not show the value until the document is shipped.
What is the best way to do this calculation?
0
Answers
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Amount including vat is updated when the document is released.
I need this field just to see that amount as I entering the sales line, without releasing it.
could someone send me an code example with the calculation, still have problems...
the code:
And put recSalesLine.Amount on the subform, but outside the tablebox and make it non-editable.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
http://www.BiloBeauty.com
http://www.autismspeaks.org
I used something similar to this code after a user is finished doing entry to obtain the TOTAL before posting. We also write some of our orders to an intermediate database for WEB purposes so we needed to be able to obtain the TOTAL before posting. Simply put this in a button on the form, works just about the same as pressing 'F9' key.
You might want to add a textbox and/or use it in a trigger in some way.
Thanks.
Those values are calculated what the Sales Order is released.
emulsified, you were right. I can't use Amount and "Amount Including VAT".
could you explain your code, please, I am not quite sure that I understand it (still newbee). where should I put this code? How should I use this code with a textbox?
I would like not to use any buttons to CALC that field.
Select the table box and drag it up to create just enuf space at the bottom or top to fit a textbox.
View->Globals
-Add a function called CalcRunningTotal (or something)
-Add a Variable: recSalesLine-Record-Sales Line
Add this code to the function
CalcRunningTotal()
Now add a textbox to the space created when moving up the Table Box.
Add to it's sourceExp: recSalesLine."Line Amount"
Make sure the property VertGlue is Bottom
It should look like this:
http://savatage99.googlepages.com/Textb ... bleBox.JPG
finally add
OnAfterGetCurrRecord()
http://www.BiloBeauty.com
http://www.autismspeaks.org
Depending on boolean "Show Totals on Purch. Inv./CM." in the Purchase Setup form 55 shows the total of the lines like you want it in the Sales Order.
Maybe you could take a look how it's made and use same functionality for the sales order?
Tino Ruijs
Microsoft Dynamics NAV specialist