1
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
MURRAY FIFE
DYNAMICS AX 2012 TIPS & TRICKS
ADDING A MENU ITEM FOR THE WAREHOUSE MANAGEMENT MOBILE CLIENT TO THE TOOLS MENU
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
ADDING A MENU ITEM FOR THE WAREHOUSE
MANAGEMENT MOBILE CLIENT TO THE TOOLS MENU
BY MURRAY FIFE
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Copyright © 2014 Murray Fife
All Rights Reserved
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
What You Need For This Guide
All the examples shown in this blueprint were done with the Microsoft Dynamics AX 2012 virtual machine image that was downloaded from the Microsoft CustomerSource or PartnerSource site. If you don't have your own installation of Microsoft Dynamics AX 2012, you can also use the images found on the Microsoft Learning Download Center or deployed through Lifecycle Services. The following list of software from the virtual image was leveraged within this guide:
• Microsoft Dynamics AX 2012 R3
Even though all the preceding software was used during the development and testing of the recipes in this book, they may also work on earlier versions of the software with minor tweaks and adjustments, and should also work on later versions without any changes.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by emailing [email protected].
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at [email protected] with a l ink to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at [email protected] if you are having a problem with any aspect of the book, and we will do our best to address it.
Preface
7
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Adding A Menu Item For The
Warehouse Management Mobile
Client To The Tools Menu
Now that Dynamics AX R3 is available you may be working with the new Warehouse Management browser client. And if you are like me, opening up the browser window and then typing in the URL (http://localhost:82) may just be too much work and giving you serious carpel tunnel syndrome. Don’t worry though, if you want to write a couple of lines of code then you can easily add a menu item to your Tools menu that will open the mobile client up with just a click of the mouse.
It’s like having your own personal Stargate… sort of…
8
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
To start off, access the Tools menu by clicking on the Files menu and then clicking on the Tools sub-menu. There is more than enough space for another menu item.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
9
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
The first task that we need to do is create a Class within AOT that will open up the web page for us. To so that, open up AOT and then expand out the Classes folder.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
10
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Right-mouse-click on the Classes folder itself, and select the New Class from the context menu.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
11
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Now you should see a new generic Class.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
12
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Change the Name field within the Properties pane to something a little more useful like WHSMobileDeviceBrowserand then double click on the class.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
13
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
This will open up the code editor for the Class.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
14
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Press CTRL+N to create a new method for the class.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
15
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
And then change the method to be:
static void main(Args _args){
infolog.urllookup(“http://localhost:82”);}
Then close out the editor.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
16
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
To test the code, just right-mouse-click on the class and select the Open menu item.
17
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
This should open up a browser window for you and take you straight to the mobile device portal.
18
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Now we need to create a Menu Item that will call the class. To do this open up the Menu Items group within AOTand expand out the Display group.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
19
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Right-mouse-click on the Display node and select the New Menu Item option.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
20
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
This will create a new generic menu item for you.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
21
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Change the Name property to something a little better than the default – like WHSOpenMobileDeviceBrowser.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
22
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Then change the Client Type to Class.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
23
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
This will allow you to select your Class that you created in the last step.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
24
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Finally, give the Menu Item a Label and Help Text before saving the change.
25
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
You can test the Menu item just like you did with the Class by right-mouse-clicking on the menu item and selecting the Open menu item.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
26
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
If everything is configured correctly then the browser window should open up again.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
27
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Now for the last step, which is to add the menu item to the Tools menu. To do this, open up the Menus group within AOTand find the GlobalToosMenu object.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
28
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Right-mouse-click on it and select the New menu item and the Menu Item sub-menu option.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
29
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
This will add a new menu item to the end of the menu.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
30
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
From the MenuItemName dropdown, select the new menu item that you just created.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
31
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
This will automatically update the Menu Item Name for you.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
32
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Now just save your changes to AOT.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
33
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Now if you open up the Tools menu you will see a new menu item for opening the browser window.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
34
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Clicking on the menu item takes you straight to the client.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
35
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
If you want to make it even better, you can make one small change – if you click on the login button, you will notice that the URL is slightly different.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
36
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
If you change the main() method to point to that URL rather than the base one then you will even bypass the splash screen.
Now we’re cooking with oil.
Adding A Menu Item For The Warehouse Management Mobile Client To The Tools Menu
37
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
38
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
The Tips & Tricks series is a compilation of all the cool things that I have found that you can do within Dynamics AX, and are also the basis for my Tips & Tricks presentations that I have been giving for the AXUG, and online. Unfortunately book page size restrictions mean that I can only fit 50 tips & tricks per book, but I will create new volumes every time I reach the 50 Tip mark. If you want to view all of the compilations then here are the links.
50 Tips & Tricks For Dynamics AX 2012http://www.amazon.com/dp/1495487776/
Another 50 Tips & Tricks for Dynamics AXhttp://www.amazon.com/dp/1497383412/
Want More Tips & Tricks
39
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
40
TIP & TRICKS FOR DYNAMICS AX 2012
© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com
Murray Fife is a Microsoft Dynamics AX MVP, and Author with over 20 years of experience in the software industry.
Like most people in this industry he has paid his dues as a developer, an implementation consultant, a trainer, and now spend most of his days working with companies solving their problems with the Microsoft suite of products, specializing in the Dynamics® AX solutions.
EMAIL [email protected]
TWITTER @murrayfife
SKYPE murrayfife
AMAZON www.amazon.com/author/murrayfife
WEB www.dynamicsaxcompanions.com
About the Author
Top Related