NAV Extensions - Page Actions

Jut
Member Posts: 72
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
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
Best Answer
-
yes, you need subscriber event per page action..5
Answers
-
yes, you are right.
no code is allowed on standard objects.
you can use OnAfterActionEvent event and get the recordref there and use RecordRef.NUMBER for table id.
0 -
HI Mohana,
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?0 -
P.S: One problem with the Event-solution:
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?0 -
yes, you need subscriber event per page action..5
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions