SBX - Search With Button

SBX - Forum Post Title

Finding Fields from Source Expression

Microsoft Dynamics NAV Forum

mysamza asked a question on 6 Jun 2019 2:51 PM

Question Status

Suggested Answer

There is a field named Invoice Discount % on the Sales Quote Card.

I need to show this field's value in the Sales Quote (Report 206) but I can't find this field in either the Sales Header or Sales Line. It shows in the SourceExpression. The screenshot I attached above is from Tab SourceExpression. How do I locate this field?

Thanks a lot in advance.

Reply
Teddy Herryanto responded on 6 Jun 2019 3:51 PM
My Badges
Suggested Answer

The invoice discount % is not a standard NAV. It is probably calculated on the open page.

Reply
Andrea Antoniazzi responded on 7 Jun 2019 2:30 AM
My Badges

Hi,

the "Invoice Discount %" is not a field, so is calculated with a function.

If you look in the page 95 "Sales Quote Subform" you can find the variable InvoiceDiscountPct.

This variable is calcualated with this code:

InvoiceDiscountPct := SalesCalcDiscByType.GetCustInvoiceDiscountPct(Rec);

SalesCalcDiscByType is a global variable on codeunit "Sales - Calc Discount By Type"

Best regards

Reply
mysamza responded on 7 Jun 2019 7:07 AM

How do you suggest I access the field's value that is calculated at CodeUnit 56 that is Sales - Calc Discount By Type? I tried making a global variable of type Codeunit and tried accessing VarCreated.GetCustInvoiceDiscountPct(RECORDREF) but it would tell me RECORDREF should belong to 37 and not 0.

Thank you in advance for pointing me in the direction I can get this figured out!

Reply
Teddy Herryanto responded on 6 Jun 2019 3:51 PM
My Badges
Suggested Answer

The invoice discount % is not a standard NAV. It is probably calculated on the open page.

Reply

SBX - Two Col Forum

SBX - Migrated JS