Hi mates :)
I need your help. Mi idea is to change the description value on General Ledger Entries (or create a new one if I can't) depending on the document type.
For example, if Document Type is "Invoice", I want to put the description of the first line of the invoice.
If document type is "Credit Memo", I want to put the desription of the first line of the memo.
I tried something like this but didn't work, could you help me? Thanks :D
pageextension 79130 GeneralLedgerEntries extends "General Ledger Entries"
{
layout
{
addafter("Document No.")
{
field("Desc2"; rec.Desc2)
{
ApplicationArea = all;
Caption = 'Desc. Line';
trigger OnAfterLookup(Selected: RecordRef)
var
Inv: Record "Purch. Inv. Line";
CMemo: Record "Purch. Cr. Memo Line";
begin
if rec."Document Type" = 2 then
Rec.Desc2 := Inv.Description;
if rec."Document Type" = 3 then
Rec.Desc2 := CMemo.Description;
end;
}
}
}
}