Execute code in menu

clembo
Member Posts: 122
I'm migrating old database version (2.60) to 2009 R2.
In old version there is a table used to store different data type. To accomplish this when user open form from menu applied a specific filter. So when I open from menu Item "Car" menu open form applying specific filter. When I open from menu item "byke" menu open form (same form) applyig specific filter to view only "Byke".
In new version there is a way to do it? Can I call from menu a form executing code?
If not how I can solve this problem. I think that solution is makedifferent form but this request too form object and I don't want to do it.
In old version there is a table used to store different data type. To accomplish this when user open form from menu applied a specific filter. So when I open from menu Item "Car" menu open form applying specific filter. When I open from menu item "byke" menu open form (same form) applyig specific filter to view only "Byke".
In new version there is a way to do it? Can I call from menu a form executing code?
If not how I can solve this problem. I think that solution is makedifferent form but this request too form object and I don't want to do it.
0
Comments
-
Hi,
you need to call a codeunit from the menu, this can call the form with the filter. I don't know another way.
With best regards
Jens0 -
So I need to create a function for every type of data to show in a form?0
-
Unfortunately, yes.
with best regards
Jens0 -
Guess, you're talking about incadea.engine. Right?
I think it's not a problem to use that code:Vehicle.RESET; Vehicle.FILTERGROUP(2); Vehicle.SETFILTER("Vehicle Type",%1',"Vehicle Type"::Byke); Vehicle.FILTERGROUP(0); FORM.RUN(FORM::"Byke Card",Vehicle);
or am I wrong?Sincerely yours, GRIZZLY
Follow my blog at http://x-dynamics.blogspot.com0 -
What is incadea.engine?0
-
Vertical solution for autodealers, based on NAV 2.6
BTW, is that code fits you?Sincerely yours, GRIZZLY
Follow my blog at http://x-dynamics.blogspot.com0 -
clembo wrote:I'm migrating old database version (2.60) to 2009 R2.
In old version there is a table used to store different data type. To accomplish this when user open form from menu applied a specific filter. So when I open from menu Item "Car" menu open form applying specific filter. When I open from menu item "byke" menu open form (same form) applyig specific filter to view only "Byke".
In new version there is a way to do it? Can I call from menu a form executing code?
If not how I can solve this problem. I think that solution is makedifferent form but this request too form object and I don't want to do it.
Not sure I got it right but I think this could help you:
You could use the RunFormView property of the actions that you use to launch page.Action 1: RunObject -> YourPage RunFormView -> Type=Const(Byke) Action 2 -> RunObject -> YourPage RunFormView -> Type=Const(Car)
Hope this could help.~Rik~
It works as expected... More or Less...0 -
But I want to use classic client, not Role Tailored.
When I create a new item I must to specify object type and object name.
So where I can write this code?0 -
clembo wrote:But I want to use classic client, not Role Tailored.
When I create a new item I must to specify object type and object name.
So where I can write this code?
:oops: I'm sorry I didn't understand you want to use classic!
I think that you have 2 ways:
1. one codeunit as Jens suggest
2. split your form in 2 forms one for byke and one for car~Rik~
It works as expected... More or Less...0 -
OFF: Stupid menu structure. 3.70 Main Menu form was the best solution.Sincerely yours, GRIZZLY
Follow my blog at http://x-dynamics.blogspot.com0 -
GRIZZLY wrote:OFF: Stupid menu structure. 3.70 Main Menu form was the best solution.
nice!
~Rik~
It works as expected... More or Less...0 -
Ehm .. don't work.
If I need to esecute specific code I need to create one codeunti for every form. So this is not good idea.
Other choice?0 -
What about displaying dialog with options on opening the form?
User should select what he wants to see, then the filter should be applied.
So, the concept is that menu has 1 item, when clicking it an additional dialog is shown.Sincerely yours, GRIZZLY
Follow my blog at http://x-dynamics.blogspot.com0
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