pageextension 50100 "Source Page Ext" extends "Source Page"
{
actions
{
addafter(ActionItems)
{
action(InsertRecordsAction)
{
ApplicationArea = All;
trigger OnAction()
begin
InsertRecordsFunction();
end;
}
{
Image = InsertRecords;
Caption = 'Insert Records';
}
}
}
}
codeunit 50100 "Source Page Codeunit"
{
procedure InsertRecordsFunction()
var
SourcePageRecord: Record "Source Table";
DestinationPageRecord: Record "Destination Table";
begin
SourcePageRecord.RESET;
SourcePageRecord.SETRANGE("Field", 'FilterValue');
IF SourcePageRecord.FINDSET THEN
BEGIN
REPEAT
DestinationPageRecord.INIT;
DestinationPageRecord."Field" := SourcePageRecord."Field";
DestinationPageRecord.INSERT;
UNTIL SourcePageRecord.NEXT = 0;
END;
end;
}
André Arnaud de Cal...
293,001
Super User 2025 Season 1
Martin Dráb
231,837
Most Valuable Professional
nmaenpaa
101,156
Moderator