What do I need to do?
I need to write a handler that intercepts the Gen. Jnl. Template lookup when opening a General Journal with multiple templates of the same type defined, then select a specific one and return with LookupOK.
What have I tried?
I have the following method that is declared as [ModalPageHandler]:
[ModalPageHandler]
procedure SelectTemplateHandler(var zhePage: TestPage "General Journal Template List")
var
t : Variant;
begin
zhePage.GoToKey('GEN-SIM');
t := zhePage.OK();
end;
- I only deducted, that
OK could be the method I am looking for. But OK is not documented anywhere. Neither is Cancel (a method of the same object). It returns a DataType called TestAction, which is unknown to AL (and C/AL aswell btw.). What do I have to do with this?
- When I do not catch the return value of
OK, the compiler errors out saying I have to catch the return value.
- The only way I got it compiling is by trapping the result inside a
Variant (as shown above). This way the extension compiles, but the test fails with no error message and Result = Failed.
- I have also tried the alternative signature of using
NameOfValriable: Page; var Response: Action. But in this case I do not have a TestPage, but only a Page. And then I do not have GoToKey method that allows me to select a specific record.
What do I need to do?
I need to write a handler that intercepts the
Gen. Jnl. Templatelookup when opening aGeneral Journalwith multiple templates of the same type defined, then select a specific one and return withLookupOK.What have I tried?
I have the following method that is declared as
[ModalPageHandler]:OKcould be the method I am looking for. ButOKis not documented anywhere. Neither isCancel(a method of the same object). It returns a DataType calledTestAction, which is unknown to AL (and C/AL aswell btw.). What do I have to do with this?OK, the compiler errors out saying I have to catch the return value.Variant(as shown above). This way the extension compiles, but the test fails with no error message and Result = Failed.NameOfValriable: Page; var Response: Action. But in this case I do not have aTestPage, but only aPage. And then I do not haveGoToKeymethod that allows me to select a specific record.