code for a button to open a new form

smiles
Member Posts: 9
Hi
I want to write a code for a button to open a new form.
Can you help me to find some tutorials and links to do so .
Thanks in advance .
I want to write a code for a button to open a new form.
Can you help me to find some tutorials and links to do so .
Thanks in advance .
0
Comments
-
On push of the button ..write Form.Runmodal(XX);
"xx " is the no. (ID) of the form u want 2 open.0 -
What are you all speaking about? :roll:
There are may be some possibilites to do this!
And first of all - use reference type!
If you have one table linked to another, you do not need to write any line of codegoing to Europe0 -
like this
***
MenuItemNameDisplay menuItemName;
MenuFunction menuFunction;
FormRun configForm;
Args args;
;
//Get the name of the menu item in the Action table that we will use
//to launch the form.
menuItemName = aifEndpointActionPolicy.displayMenuItemName();
//Create a new menu function based on the menu item name
menuFunction = new MenuFunction(menuItemName, MenuItemType::Display);
//create a populate the arguments that will be passed to the form
args = new Args();
args.caller(this);
args.record(aifEndpointActionPolicy);
//Create the form from the menu function
configForm = menuFunction.create(args);
if(configForm)
//Run the form
configForm.run();
else
//Menu item does not exist
throw error(strfmt("@SYS55489", menuItemName));
***0 -
the easier (but not the only) way:
If you want to call directly to the form:Args args; FormRun formRun; ; args = new Args(); args.name(formStr(form_name)); formRun = ClassFactory.formRunClass(args); formRun.init(); formRun.run(); formRun.wait();
If you want (and you can) call to a MenuItem (recommended), do that way:MenuFunction mf; ; mf = new MenuFunction(menuItemDisplayStr(menu_item_name), MenuItemType::Display); // Or the Type that matches mf.run();
Hope this helps.[Dynamics AX developer]
http://www.jaestevan.com (AX Dev Blog)
http://twitter.com/jaestevan (follow me!)0 -
dferraretto wrote:like this
***
MenuItemNameDisplay menuItemName;
MenuFunction menuFunction;
FormRun configForm;
Args args;
;
//Get the name of the menu item in the Action table that we will use
//to launch the form.
menuItemName = aifEndpointActionPolicy.displayMenuItemName();
//Create a new menu function based on the menu item name
menuFunction = new MenuFunction(menuItemName, MenuItemType::Display);
//create a populate the arguments that will be passed to the form
args = new Args();
args.caller(this);
args.record(aifEndpointActionPolicy);
//Create the form from the menu function
configForm = menuFunction.create(args);
if(configForm)
//Run the form
configForm.run();
else
//Menu item does not exist
throw error(strfmt("@SYS55489", menuItemName));
***
Your sharing is much appreciated.0
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