D365FFO – AX – X++ – Using dynamic query values (SysQueryRangeUtil) in Dynamics AX

Whenever I setup Cues for customers in AX 2012 I use dynamic filtering to create actionable cues representing relevant data. I do tend to forget the precise name of the methods and number of parenthesis etc. so here is the full list of end-user available methods based on the SysQueryRangeUtil class:

Most used:

NameUsed howExample
dayRange(dayRange(-1,2)) gives a query result of all records from yesterday until the day after tomorrow.Note that it is unfortunately not possible to use decimals, only full days work.
day(day(-1)) gives all records of yesterday, (day(1)) gives records of tomorrow.Remember that options such as <(day(-1)) works for identifying for example any date before yesterday
monthRange(monthRange(-1,0)) last month and this month
yearRange(yearRange(-1,0)) last year and this year
lessThanDatelessThanUtcDatelessThanUtcNow(lessThanDate(-1)) (calculated from the AX session date)(lessThanUtcDate(-1)The date represented on the AOS(lessthanUtcNow())Calculates from “Now”
greaterThanDateGreaterThanUtcDategreaterThanUtcNowgreaterThanDate(5)) (calculated from the AX session date)(greaterThanUtcDate(-1)The date represented on the AOS)(greaterthanUtcNow())Calculates from “Now”
currentUserId(currentuserid())Take the user id and filter on for example “created by”Good for making a generic query relevant for the individual users, forexample a Cue along the lines of “Sales orders I have created”
currentWorker(currentWorker()) A somewhat advanced option but nice for filtering on records where you have assigned for example a sales responsible.Note that the value returned is a record IDFor example for a cue along the lines of “Sales orders I am responsible for”
currentParty(currentparty()) Similar to the currentWorker but could potentially be used if the user was something other than a Worker.Note the returned value is a record id.
currentCompany(currentcompany())For filtering on “system” tables such as the worker table

Remember also the ability to compare two fields on the same table using the AOT names within a set of parenthesis. The system names can be found on the personalization screen. Just recently I have used it forexample in the below example to compare reequested ship date and confirmed ship date on a sales order (back) lines.

image021

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...