Hi,
I am working on an extension that needs to add actions to a number of pages. The new action is very similar on all pages. Prior to extensions in the Action-Trigger I would have called RUNMODAL to run another page while passing some parameters (rec-ref to current record and page id) to that page:
<Action1906359306> - OnAction()
MyRecRef.GETTABLE(Rec);
OtherPage.LoadDataSet(MyRecRef,CurrPage.OBJECTID(FALSE));
OtherPage.RUNMODAL;
With extension it seems that no code is allowed on page actions - I may only call a page or codeunit via RunObject-properties. The problem is that this does not allow me to make it generic since the Codeunit (or Event) is always strongly coupled with the source table (and I do not see a way to pass the page id). At least I found no generic solution.
Any idea?
Thanks!
Jut
0
Answers
no code is allowed on standard objects.
you can use OnAfterActionEvent event and get the recordref there and use RecordRef.NUMBER for table id.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Thank you for your quick response. That's a good idea - what I still need to solve is to pass the page number of the object where the action was called to my OnAfterAtionEvent. Do you think that is somehow possible?
isn't the event subscriber always tied to a certain record?
LOCAL [EventSubscriber] CallEvent(VAR Rec : Record "Gen. Journal Line")
That would mean that I need one event subscriber per source table, right?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav