Hello experts I have a requirement.
1. Here is the following code that inserts some records into the table named buffer table, here the problem is these 2 lines in my code run before the record inserting.
2. Here I need the same 2 lines do requirements after inserting these records,
shows the matched records of the buffer table by validating with the filed named (No.) of the purchase line.
Here is the Main code.
pageextension 71516710 myect extends /Purchase Order Subform/
{
actions
{
addafter(BlanketOrder)
{
action(Quality)
{
ApplicationArea = All;
Caption = 'Quality';
Image = Action;
ToolTip = 'Open the quality dialog box for the selected item';
RunObject = page QualityDialog;
RunPageLink = /Item No./ = field(/No./);
trigger OnAction()
var
QualityDialog: Page QualityDialog;
QualityCode: Record QualityCodeTable;
Item: Record Item;
PurchaseLine: Record /Purchase Line/;
begin
CurrPage.SetSelectionFilter(PurchaseLine);
if PurchaseLine.FindFirst() then begin
if (PurchaseLine.Type = PurchaseLine.Type::Item) or (PurchaseLine.Type = PurchaseLine.Type::/Fixed Asset/) then begin
Item.Get(PurchaseLine./No./);
if Item./Quality Applicable/ and (Item./Quality code/ <> '') then begin
MyProcedure(Item, PurchaseLine, QualityDialog);
end
else
Error('The item %1 does not have a quality code assigned.', Item./No./);
end
else
Error('The item %1 is not quality applicable.', Item./No./);
end
else
Error('The line type %1 is not supported for quality.', PurchaseLine.Type);
end;
}
}
}
var
PurchaseHeader: Record /Purchase Header/;
local procedure MyProcedure(var Item: Record Item; var Rec: Record /Purchase Line/; var DialogBox: Page QualityDialog)
var
MainTable: Record QualityCodeTable;
PartTable: Record QualityParamater;
qualityparasubform: Record QualityParamaterSubform;
BufferTable: Record QualityCodeTabletestdialoug;
PurchaseLine: Record /Purchase Line/;
ItemFilter: Record Item;
begin
qualityparasubform.SetRange(/No./, Item./Quality code/);
qualityparasubform.SetRange(/Item No./, Item./No./);
if qualityparasubform.FindSet() then begin
repeat
BufferTable.SetRange(Number_buffer, qualityparasubform./No./);
BufferTable.SetRange(/Item No./, qualityparasubform./Item No./);
BufferTable.SetRange(/Quality Parameter Code/, qualityparasubform./Quality Paramater Code/);
if not BufferTable.FindFirst() then begin
BufferTable.Init();
BufferTable.Number_buffer := qualityparasubform./No./;
BufferTable./Item No./ := qualityparasubform./Item No./;
BufferTable./Line No/ := qualityparasubform./Line No/;
BufferTable./Quality Parameter Code/ := qualityparasubform./Quality Paramater Code/;
BufferTable.Particulars := qualityparasubform.Particulars;
BufferTable./Approved Parameters/ := qualityparasubform./Approved Parameters/;
BufferTable./Unit of Measurement/ := qualityparasubform./Unit of Measurement/;
BufferTable.Remarks := qualityparasubform.Remarks;
BufferTable.Insert(true)
end
else begin
BufferTable.Number_buffer := qualityparasubform./No./;
BufferTable./Item No./ := qualityparasubform./Item No./;
BufferTable./Quality Parameter Code/ := qualityparasubform./Quality Paramater Code/;
BufferTable./Line No/ := qualityparasubform./Line No/;
BufferTable.Particulars := qualityparasubform.Particulars;
BufferTable./Approved Parameters/ := qualityparasubform./Approved Parameters/;
BufferTable./Unit of Measurement/ := qualityparasubform./Unit of Measurement/;
BufferTable.Remarks := qualityparasubform.Remarks;
BufferTable.Modify();
end;
until qualityparasubform.Next() = 0;
end;
end;
}