Fields from Source Expression.

mysamzamysamza Posts: 14Member
edited 2019-06-06 in NAV Three Tier
There is a field named Invoice Discount % on the Sales Quote Card.
875xek1kp1rc.png

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.

Answers

  • AluanAluan Posts: 37Member
    Hey mysamza,

    i guess you are talking about the Sales Quote Subform (95)?
    If so, the Field should be calculated within a function.

    SalesCalcDiscByType.GetCustInvoiceDiscountPct(Rec)
    SalesCalcDiscByType -> Codeunit 56 (Sales - Calc Discount By Type)


  • mysamzamysamza Posts: 14Member
    How do you suggest I access the field value that is calculated at CodeUnit 56 in Sales Quote Subform? I tried making a global variable of Codeunit 56 and tried accessing VarCreated.GetCustInvoiceDiscountPct(RECORDREF) but it would tell me RECORDREF should belong to 37 and not 0
  • AluanAluan Posts: 37Member
    You need to pass an Record of the Sales Line. (Table 37)
    If you use the Sales - Quote Report, you can call the Function after the Sales Line DataItem.
    Example:
    SalesCalcDiscountByType.GetCustInvoiceDiscountPct("Sales Line")

    SalesCalcDiscountByType -> Codeunit (Global Variable)
    "Sales Line" -> Defined in the Dataset

    So you have to create a Variable for the Codeunit.
    Add a Column after the DataItem Sales Line:
    Data Type: Column
    Data Source: SalesCalcDiscountByType.GetCustInvoiceDiscountPct("Sales Line")
    Name: The Name (That's the name you can select in the Report)




Sign In or Register to comment.