Hi All.
I am planning to migrate all my code from C/AL to AL
some can use events
but how about if i want to put my code in between nav standard code
for example
In table 37 (Sales Line), there is function name CalcVATAmountLines
in the middle of the function there is code like this
//Nav Standard
CASE QtyType OF
QtyType::General:
BEGIN
VATAmountLine.Quantity += "Quantity (Base)";
VATAmountLine.SumLine(
"Line Amount","Inv. Discount Amount","VAT Difference","Allow Invoice Disc.","Prepayment Line");
END;
I want to change to my customized code like this
I have added 3 more parameters for sumline function
//CAL Customization
CASE QtyType OF
QtyType::General:
BEGIN
VATAmountLine.Quantity += "Quantity (Base)";
VATAmountLine.SumLine(
"Line Amount","Inv. Discount Amount","VAT Difference","Allow Invoice Disc.","Prepayment Line",2,"Document Type","Document No.");
END;
and in the table 290 (VAT Amount Line)
[External] SumLine
"Line Amount" += LineAmount;
IF AllowInvDisc THEN
"Inv. Disc. Base Amount" += LineAmount;
"Invoice Discount Amount" += InvDiscAmount;
"VAT Difference" += VATDifference;
IF Prepayment THEN
"Includes Prepayment" := TRUE;
//Start Customized
"Transaction Type" := ParTransactionType;
"Document Type" := ParDocumentType;
"Document No." := ParDocumentNo;
//End Customized
MODIFY;
all the bold one is my customized code
how should i do that in AL?
Thanks before
Answers
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
But how about in between standard code?