In Dynamics AX, the role center may contain a lot, but some times it is wanted to show more specific and isolated information. In this blog-post I would like to show you how to create a cue that only shows number of sales and amount related to a specific retail store. This blogpost is meant to show the pattern we can use, and is not only restricted to retail. We can use this technic almost everywhere in Dynamics AX.
Here we see a CUE where I show the number of sales and the amount for a specific store. But the nice thing here, it that the values changes depending on what store the user is assigned to.
Do be able to do this we need a dynamic query, that changes the store, depending on the current user, and we need to have a place, where a user is assigned to a store. This is already available in Dynamics AX, and is a setting on the User profiles
So here, I’m assigning a user to a role, and to a store. The next thing I need to have is a way to sum up all the retail sales transactions, and for this I use the form Retail sales transactions.
I then create an advanced filter by using the CTRL-F3, and save as a CUE.
You see here that in the criteria for store number, I write (EGCurrentRetailStoreID()). This is a very nice trick in Dynamics AX. The ability to create dynamic queries. I have blogged about it before here.
The code needed to use dynamic query criteria is located in SysQueryRangeUtil is the following:
This code will return the store ID for the current user. The last step is to select the CUE in the shared role center.
Then you have a CUE, that shows the sales in your local retail store.