Uncategorized

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

I appreciate that I can be a part of this worldwide blog community—as a consultant working from Norway, the blog lets me share more than 20 years of experience with Microsoft Dynamics 365. Along the way, I participated in developing retail, PDA/RF, barcoding, master data, kitting and WMS-solutions for Dynamics. My blog focuses on my deepest interests and expertise: along with a 360 degree view of digital transformation topics, I welcome opportunities to dive into retail and intercompany supply chain automation, logistics, and production—everything that is moving around in a truly connected enterprise. As Enterprise Architect on Dynamics 365, I specialize in strategic development and planning for corporate vertical solutions and works to build international networks that increase knowledge and understanding for Dynamics 365. As an advocate for both providers and customers, I'm committed to ensure that customers constantly changing needs are meet, and I see community as key for increasing expertise. I welcome you to connect with me.

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

  1. Rolf Eriksen

    Hi Kurt

    This was a good tip, also for us ‘tullinger’ working mainly in Finance 🙂

    /Rolf

    Like

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

    Like

  3. 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

  4. Randy Granger

    Good stuff Kurt.

    Sent from my iPhone

    Like

Leave a 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 )

Google photo

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

Twitter picture

You are commenting using your Twitter 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.

%d bloggers like this: