page 60100 BIRemainingItemQuantity
{
ApplicationArea = All;
Caption = 'Remaining Item Quantity';
PageType = List;
SourceTable = /Item Ledger Entry/;
Permissions = tabledata /Item Ledger Entry/ = R;
DataCaptionFields = /Entry No./;
UsageCategory = History;
DeleteAllowed = false;
ModifyAllowed = false;
InsertAllowed = false;
layout
{
area(content)
{
repeater(General)
{
//Company name variable will be extracted from a third party Company object
field(/Entity/; CompanyName)
{
ApplicationArea = All;
ToolTip = 'Specifies the Company/Entity in which the item belongs to.';
}
field(/Item No./; Rec./Item No./)
{
ApplicationArea = All;
ToolTip = 'Specifies the item number or UID for that item.';
}
field(/Location Code/; Rec./Location Code/)
{
ApplicationArea = All;
ToolTip = 'Specifies the code for the location that the entry is linked to.';
}
field(/Variant Code/; Rec./Variant Code/)
{
ApplicationArea = All;
ToolTip = 'Specifies the Variant Code.';
}
field(/Remaining Quantity/; Rec./Remaining Quantity/)
{
ApplicationArea = All;
ToolTip = 'Specifies the quantity in the Quantity field that remains to be processed.';
}
}
}
}
trigger OnOpenPage();
var
//Fetch company record
Company: Record /Company Information/;
//Define company name variable
CompanyName: Text;
begin
Rec.SetFilter(/Remaining Quantity/, '<>%1', 0);
if Company.Get() then
Message('Current Company /%1/', Company.Name);
Company.ChangeCompany('Company 2');
//Add extra records.....
//Switch Again
Rec.ChangeCompany('Company 1');
if Company.Get() then
Message('Switched To/%1/', Company.Name);
end;
trigger OnAfterGetRecord()
//On Each Record, Embed a new field which displays the company name
var
//Fetch company record
Company: Record /Company Information/;
//Define company name variable
CompanyName: Text;
begin
//Assign the CompanyName variable to the Company Name which is fetched from the Company object
if Company.Get() then
CompanyName := Company.Name;
end;
}