Announcements
Dear all,
Am trying to bring Customer Name from Cust. Ledger Entry (21) to the Detailed Cust. Ledg. Entry (379). Right now only customer num is available in Detailed Customer Ledger Entry Page.
but am stuck in the code, pls correct if am doing wrong
pageextension 60022 "CusName DetailCustLed Entry" extends "Detailed Cust. Ledg. Entries"
{
layout
{
addafter("Customer No.")
{
field("Customer Name"; CustomerName)
{
ApplicationArea = All;
Caption = 'Customer Name';
}
}
}
TRIGGER OnAfterGetRecord();
BEGIN
clear(CustomerName);
IF Rec."Entry No." = Rec."Cust. Ledger Entry No."::"Cust. Ledger Entry" THEN BEGIN
TempCustLedEntry.RESET;
TempCustLedEntry.DELETEALL;
DetailedCustomerLedgerEntries.GetGLEntries(Rec, TempCustLedEntry);
TempCustLedEntry.findfirst;
CustomerName := TempCustLedEntry."Customer Name";
END;
END;
var
CustomerName: Code[50];
TempCustLedEntry: Record "Cust. Ledger Entry" temporary;
DetailedCustomerLedgerEntries: Codeunit DetailedCustomerLedgerEntries;
}
Thanks Nitin. its works as expected.
Hi LearnBC ,
Please change your code as per below, and see if it fulfill your requirement.
pageextension 60022"CusName DetailCustLed Entry" extends "Detailed Cust. Ledg. Entries"
{
layout
{
addafter("Customer No.")
{
field("Customer Name"; CustomerName)
{
ApplicationArea = All;
Caption = 'Customer Name';
}
}
}
TRIGGER OnAfterGetRecord();
var
Customer: Record Customer;
BEGIN
clear(CustomerName);
if Customer.get(rec."Customer No.") then
CustomerName := Customer.Name;
// IF Rec."Entry No." = Rec."Cust. Ledger Entry No."::"Cust. Ledger Entry" THEN BEGIN
// TempCustLedEntry.RESET;
// TempCustLedEntry.DELETEALL;
// DetailedCustomerLedgerEntries.GetGLEntries(Rec, TempCustLedEntry);
// TempCustLedEntry.findfirst;
// CustomerName := TempCustLedEntry."Customer Name";
// END;
END;
var
CustomerName: Code[50];
// TempCustLedEntry: Record "Cust. Ledger Entry" temporary;
// DetailedCustomerLedgerEntries: Codeunit DetailedCustomerLedgerEntries;
}
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156