Cue Run Class in Microsoft Dynamics AX 2012



Cue Run class in Microsoft Dynamics AX 2012




So many blogs, I found which explain you how to create cue and use it in the form as a part, but you can find cue can also display the number of records display aside with the cue. In this blog, I am explaining the same, how any cue can calculate the total number of records and display on the form.

It completely depends on the relation between the tables used in the cues and in the forms where that cue is used. 

Now talking about CueRun class, this class is used whenever any form is open and have cue part in it, it is the main class which builds the query to fetch the related records for particular cue. The method of this class invokes a number of times, depends on how much cues used in the form.

A method called “ApplyTableContext” in the CueRun class, which have a logic to detect the relation of tables. The relation is then used to create a range for query that use for fetching the records for particular cue. Afterwards it will pass the value from the caller record in the same query build range. 

This is how the cue can get the number of records and display it on your form, experience it by debug the said method. It has very useful logic, which can help in so many ways.

Cheers...

Comments