How to use dynamic date ranges in RoleCenter Cue’s

In Dynamics AX 2012 (and 2009) we have the possibility to add Cue’s to the role center.

image

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.

image

In AX 2012 you will find many such «dynamic» data query values, and you can find them in the class SysQueryRangeUtil.

image

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()

image

image

Or here is a way if you have a CreateDateTime field, like, and want all orders created today:

image

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

6 thoughts on “How to use dynamic date ranges in RoleCenter Cue’s

  1. Pay *special attention* to the wrapping parentheses. So the value in the metafield needs those wrapping parentheses to work: ( somemethod() ).

    Like

  2. 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. 🙂

    Like

Leave a Reply to Randy Granger Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.