Add SharePoint Documents Libraries As Menu Links
Posted by Author, Curator, Visually Impared Squirrel Literacy Advocate & Dynamics AX Technical Solution Professional (TSP) at Microsoft on
Storing documents within SharePoint is cool. It allows you to browse through the documents, it allows you to have version control, it allows you to add metadata that you can use to search for documents, it does everything. The problem is that if you work in the AX client all the time, then you have to switch out of the application in order to view all the related documents. Don’t worry. If you want to access all of the documents from within Dynamics AX then you can add it to the menu.
Now all of the Axoraphobiacs out there don’t have to leave the application all day.
How To Do It…
First, start off by finding your document library within SharePoint and note down the URL for the document library.
And then find the location where you want to put your link to the Documents…
The first step is to create a form that will show the Documents. To do that, open up a new development environment (CTRL+D) right-mouse-click on the Forms group, and select the New Form menu item.
When the new form is created, change the Name in the Properties to something a little more friendly.
Now we need to add a web browser control to the form. To do that expand out the form details, and expand the Designs group.
Then right mouse click on the Design design click on the New Control submenu, and select the ActiveX menu item.
When the ActiveX browser is displayed, scroll down and select the Microsoft Web Browser control and click on the OK button.
Now you should see that the ActiveX control has been added to the form design.
Change the Width property to Column Width and the Height property to Column Height so that it will expand to take up all of the real-estate in the form.
Now we need to make sure that the browser points to our document management library. To do that right-mouse-click on the Methods group, select the Override method menu and click on the Activate method in the sub-menu.
Then add the following lines to the body:
Notice that the URL is just the URL to the document library.
Now we need to add a menu item to open up the form. To do this, expand the Menu Items group, and then right-mouse-click on the Display subfolder and select the New Menu Item menu item.
When the new menu item is displayed, give it a more appropriate Name and Label, and then select the new form that you just created from the Object drop down.
Also, set the RunOn property to Client.
Finally we now need to add the menu item to a menu. To do that, open up the Menus group, and expand the menu that you want to modify (in this case the AccountsPayable).
Right-mouse-click on the menu, and New menu and select the Submenu option.
This will create a new submenu group for you that you can call Documents.
Then right-mouse-click on that submenu, and select the New menu, and this time select the Menu Item option.
When the menu item is displayed, change the MenuItemName to be the form that you initially created.
Then save your changes and exit from the development environment.
How It Works…
Now when you open up your menu there will be a new link there for your document library…
And clicking on it will open up your document library within the Dynamics AX client.
How cool is that.
Share this post
- 0 comment
- Tags: Dynamics AX