Hi Greg,
I tested with Page.Close;
I used code like this
trigger OnInit()
var
MonthCheck: Text[2];
begin
MonthCheck := Format(Today, 0, '<Month,2>');
if MonthCheck = '11' then
Message('Closing the page');
CurrPage.Close()
end;
1. In OnInit, the message popped up but the page did not close.
2. In OnOpenPage, it did not work either and the page opened.
3. But in OnAfterGetRecord, the message popped up number of times of the record, but the page did close.
4. In OnAfterGetCurrRecord(), the message popped up only once and the page closed.
So maybe either OnAfterGetRecord or OnAfterGetCurrRecord can be some solution.
I will further test this options, and thank you for your help.