SBX - Search With Button

SBX - Forum Post Title

Amount Incl VAT value in Sales Quote Report.

Microsoft Dynamics NAV Forum

mysamza asked a question on 7 Jun 2019 2:56 PM

Question Status

Verified

So I am using the below code to add the amount in words to the Sales Quote report. I have already successfully achieved it with the Sales Invoice report using the following code.

Header - OnAfterGetRecord()

gRpt_Cheque.FormatNoText(notext,"Sales Header"."Amount Including VAT","Sales Header"."Currency Code");

 To get straight to the issue I am facing; The AmountIncVAT field gives me Zero when I am doing it in the Sales Quote report. It give the right value of AmountIncVAT when I did it for the Sales Invoice.

What am I missing out? The Sales Quote will be printed from the Sales Quote Card, is the AmountIncVAT field giving me ZERO value because the document is OPEN? Does AmountIncVAT field only get calculated when the Document is posted? In Sales Invoice case where I said it worked fine is it because of Sales Invoice was posted?

Thanks for the help in advance!

Reply
I Gusti Made Ari Permadi responded on 9 Jun 2019 8:15 PM
My Badges
Verified Answer

You need to add below code before your code as the field is flow field :

Header - OnAfterGetRecord()

"Sales Header".CALCFIELDS("Amount Including VAT"); //add this 

gRpt_Cheque.FormatNoText(notext,"Sales Header"."Amount Including VAT","Sales Header"."Currency Code");




Reply
Teddy Herryanto responded on 10 Jun 2019 3:05 PM
My Badges
Verified Answer

Amount Including VAT is a flow field. Meaning that if does not have a value until you calculate it.

Do the CALCFIELDS first to get the value.

Reply
I Gusti Made Ari Permadi responded on 9 Jun 2019 8:15 PM
My Badges
Verified Answer

You need to add below code before your code as the field is flow field :

Header - OnAfterGetRecord()

"Sales Header".CALCFIELDS("Amount Including VAT"); //add this 

gRpt_Cheque.FormatNoText(notext,"Sales Header"."Amount Including VAT","Sales Header"."Currency Code");




Reply
Teddy Herryanto responded on 10 Jun 2019 3:05 PM
My Badges
Verified Answer

Amount Including VAT is a flow field. Meaning that if does not have a value until you calculate it.

Do the CALCFIELDS first to get the value.

Reply

SBX - Two Col Forum

SBX - Migrated JS