I have managed to get a subform page part working successfully. It displays data sourced from a temporary table that is initialised and loaded using a procedure in a code unit that takes parameters and is called from the main page.
Here is my issue. It works perfectly if I call the procedure explicitly from within an Action defined on the page. However, no matter what page event I put it on.
Here is the action.
action("Load Temp Table")
{
ApplicationArea = All;
trigger OnAction()
var
myInt: Integer;
begin
CurrPage.Lines.Page.InitTempTable(xrec."Order Reference", xrec."Landed Cost Template");
end;
}
Here are the equivalent events called:
trigger OnAfterGetCurrRecord()
begin
CurrPage.Lines.Page.InitTempTable(xrec."Order Reference", xrec."Landed Cost Template");
end;
trigger OnOpenPage()
begin
CurrPage.Lines.Page.InitTempTable(xrec."Order Reference", xrec."Landed Cost Template");
end;
trigger OnAfterGetRecord()
begin
CurrPage.Lines.Page.InitTempTable(xrec."Order Reference", xrec."Landed Cost Template");
end;
Not one of the above events seems to execute the code automatically. The behaviour I want is that if you open a record, or move between records it will automatically populate the temporary table. I don't understand why it works form one context and not the other.