Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

Post on 19-Aug-2015

701 views 1 download

Tags:

Transcript of Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

1

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

MURRAY FIFE

DYNAMICS AX 2012 TIPS & TRICKS

EMBED POWER BI Q&A INTO YOUR MENU SO YOU CAN ASK FOR REPORTS

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

EMBED POWER BI Q&A INTO YOUR MENU SO YOU CAN ASK

FOR REPORTS

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 editor@dynamicsaxcompanions.com.

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 legal@dynamicsaxcompanions.com 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 help@dynamicsaxcompanions.com if you are having a problem with any aspect of the book, and we will do our best to address it.

Preface

6

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

7

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Embed Power BI Q&A Into Your

Menu So You Can Ask For

Reports

One of the coolest features within the Office 365 Power BI suite is the Q&A function where you can type in questions about the data and it will translate it into a query and then show you a report of the results. By linking this with your Dynamics AX data, even the most un-technical person should be able to become their own report writer. If you want to take this to the next level and make it even more accessible to the users then you may want to do a little bit of coding and add it directly to the users menus so that they can just click on the link and go straight to the Q&A page without even having to know the URL for Office 365.

It is like having your own personal data guru at your beck and call.

8

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

The first thing that you need to do is access your Power BI Q&A site so that you can get the initial URL that you want to link to the menu.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

9

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

After you know what you want to link to, you can start adding the menu item. And in order to do that we need to create a form that will be the website wrapper that we can then within the client. To do this, open up AOT and expand out the Forms group.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

10

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then right-mouse-click on the Forms group and select the New Form from the context menu.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

11

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

After you have done that you should have a generic Form control.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

12

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Change the Name property of the Form to PowerBIQA.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

13

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then expand out the PowerBIQA form and the further expand the Design node.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

14

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Right-mouse-click on the Design node, click on the New Control menu item and then select the ActiveX item.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

15

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will open up the ActiveX browser and you should be able to find the Microsoft Web Browser control and click on the OK button.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

16

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will add the control to the Design for us.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

17

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Select the ActiveX control and change the Name property to PowerBIQA so that it is less generic.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

18

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then set the Width property to Column Width so that it takes up all of the horizontal space in the design.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

19

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

And also set the Height property to Column Height so that it takes up all of the vertical space in the design.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

20

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then select the Design node and change the Window Type property to Content Page –this will allow us later on to embed the form directly within the client.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

21

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Now we need to tell the browser to navigate to the PowerBI website when it opens. To do this, right-click on the Methods group for the PowerBIQA form, select the Override Method menu item and select the Activate method.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

22

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will open up the code editor for the method.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

23

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Add the following line of code to the activate() method:

PowerBIQA.Navigate(“Your PowerBI URL”);

And then close the editor.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

24

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

When you return to AOT, right-mouse-click on the PowerBIQA form and select the Open option.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

25

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This should open up a form and show you the Power BI Q&A page.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

26

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Now we need to add this form to the menu. To do this we first need to create a menu item that points to the form. To do this, expand out the Menu Items node within AOT and then expand out the Design node.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

27

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Right-mouse-click on the Design node and select the New Menu Itemmenu item.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

28

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will create a new Menu Item control.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

29

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Change the Name property of the menu item to PowerBIOpenQA and also change the Label and Help Text properties.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

30

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Select the drop-down for the Object property, and you should be able to find the new form that you just created.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

31

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

After you have done that you can save your changes (CRTL+S) and then right-mouse-click on your new menu item control and select the Open menu item.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

32

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This should open up the form again for you.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

33

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

The final step is for us to add the menu item to the menu itself. To do that expand out the Menus node and you will see all of the main menus in the system.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

34

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Expand out the main that you want to add the menu item to - in our case it’s the SalesAndMarketingmenu.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

35

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then right-mouse click on the group that you want to add it to – which we chose the Reports folder –and select the New menu item and then the Menu itemsub-menu item.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

36

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will add a new menu item control to the menu.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

37

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

All you have to do here is select the Menu Item that you just created from the dropdown within the MenuItemNameproperty.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

38

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

And one last tweak is to set the IsDisplayedInContentArea property to Yes so that it is embedded within the client rather than a separate form.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

39

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Now just save the changes (CTRL+S) and exit and restart the Dynamics AX client.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

40

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Now when you open up your menu you will see a new menu item for Power Q&A.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

41

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Clicking on it will take you straight to the Power BI Q&A page.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

42

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Once you start asking questions, you can refine your answer…

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

43

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

And then filter out to particular records…

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

44

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

And then even compare and contrast multiple sets of data.

Now that is super cool.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

45

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

46

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

47

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

48

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

49

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 murray@dynamicsaxcompanions.com

TWITTER @murrayfife

SKYPE murrayfife

AMAZON www.amazon.com/author/murrayfife

WEB www.dynamicsaxcompanions.com

About the Author