Hi Expert. I am new for AL. I have a requirment to create a customs field /Qty.Shipped Not Invoiced/ in Item Ledge Entries. Seems very simple. /Qty. Shipped Not Invoiced/ = Quantity- “Invoiced Quantity”. I already created new field /Qty. Shipped Not Invoiced/, I run the extension, but calculation is not working. The column only show “0”. I tried many times but all failed.
Can I have any help on this code? Thanks
tableextension 98932 /QTYNotInvoiced/ extends /Item Ledger Entry/
{
fields
{
field(98932; /QtyShippedNotInvoiced/; Decimal)
{
Caption = 'Qty. Shipped Not Invoiced';
DecimalPlaces = 0;
Editable = false;
}
}
trigger OnAfterInsert()
var
ILE: Record /Item Ledger Entry/;
begin
ILE.CalcFields(Quantity);
ILE.CalcFields(/Invoiced Quantity/);
QtyShippedNotInvoiced := Quantity - /Invoiced Quantity/;
end;
}
pageextension 98932 /QtyShippedNotInvoiced/ extends /Item Ledger Entries/
{
layout
{
addafter(/Invoiced Quantity/)
{
field(QtyShippedNotInvoiced; Rec.QtyShippedNotInvoiced)
{
ApplicationArea = all;
Caption = 'Qty. Shipped Not Invoiced';
DecimalPlaces = 0;
Visible = true;
}
}
}
}