In Dynamics AX 2012 (and 2009) we have the possibility to add Cue’s to the role center.
However, sometimes we would like to have Cue’s that reflect a dynamic time dimension. This is like: Orders today, Orders yesterday etc.
What we then can do is to use query values as today(), day(-1), LessThanDate(), RateRage() etc.
Like in the following example fetching sales order lines created today. Here I use the greaterThanDate(-1). Pay attention to the extra parentheses to make it work.
In AX 2012 you will find many such «dynamic» data query values, and you can find them in the class SysQueryRangeUtil.
Then here is the developers trick: Create your own methods to get the query range you need.
I have created my self some nice methods for getting a query rage for ThisWeek() and PrevWeek()
Or here is a way if you have a CreateDateTime field, like, and want all orders created today:
So now it is easy to create Role center cues with data like:
– Number of Sales order with value so far today/yesterday/this week/this month etc
Try it, and happy Daxing
Hi Kurt
This was a good tip, also for us ‘tullinger’ working mainly in Finance 🙂
/Rolf
LikeLike
Pay *special attention* to the wrapping parentheses. So the value in the metafield needs those wrapping parentheses to work: ( somemethod() ).
LikeLike
Hi Kurt,
Couldn’t you just use weekRange(-1,-1) to get last week and weekRange(1,1) to get next week…
We made our own expantion to this class for userDep() which returns the department the current user is a part of in the emplTable. Very nice for making rolecenter reports for each department without making multiple entities. 🙂
LikeLike
Thx for the comment Fredrik, and good Idea. We should ask Microsoft to include a weekRange(X,Y) in future releases.
LikeLike
Good stuff Kurt.
Sent from my iPhone
LikeLike
Thanks Randy.
LikeLike