
I am new to Business Central. I want to retrieve record using primary key from another table. I have customer table and want to fetch details from item table. I have given table relation, using current record other fields should appear. Can anyone help me with the code ?
here is a sample code:
pageextension 50100 CustomerListExt extends "Customer List"
{
layout
{
addlast(Control1)
{
field(itemNo; item."No.") { }
field(itemDesc; item.Description) { }
}
}
trigger OnAfterGetRecord()
begin
//sample item filter
item.SetRange("Country/Region of Origin Code", "Country/Region Code");
if item.FindFirst() then;
end;
var
item: record item;
}