X++ code to Create Cue in DAX 2009

RoleCente's main purpose is to show various data on homepage which user will get to see all at a glance . Cue is also one among them .
Basically Cues in DAX 2009 are used for visual representation of data . In Technical terms Output of Query is represented graphically.

How Cue Works 
1. Open PurchTable form , click on advanced filter (Ctrl + F3)
2. Give any criteria ( status == Invoiced) and click on modify -->Save as Cue
 3. Save the Cue by assigning Cue Id as "Total_POInvoiced" , Security profile(who all can use)

4. Created Cue can be viewed in Basic-->Setup->RoleCenter->Edit Cues.

5. In order to deploy , Edit Role center homepage
             a. Click on Add new webPart and select Cues Web Part.
             b. Click on modify webpart and select above created Cue "Total_POInvoiced" in    
                 property      sheet .
             c. Click on Apply and Ok .
             d. When you exit edit mode , you will see total number of pending Invoices as image .

6. If you click on Cue "Total Invoiced PO " on Rolecenter you will be navigated to form which will show only invoiced purchase orders.

Technically :
When you create Cue , record gets created in CuesQuery Table with Formname , menuItemName and Query created from user criterias.
So when user click on Cue , It will take you to Form from where you created Cue by using the value from menuItemname.

Following X++ Job Creates Cue for customer form.

static void DEV_createCue(Args _args)
    CuesQuery       cuesQuery;
    Query           query = new Query(querystr(Cust));


    cuesQuery.CueId         = "TST_CustQuery2";
    cuesQuery.Caption       = "Cue test for CustTable";
    cuesQuery.CueVersion    = 1;
    cuesQuery.CreatorUserId = curUserid();
    cuesQuery.FormName      = "CustTable";
    cuesQuery.DataSourceName = "CustTable";
    cuesQuery.Query = query.pack();
    cuesQuery.ClientMenuItemName = "CustTable";
    cuesQuery.CueMin = 1;
    cuesQuery.CueMax = 10;
    cuesQuery.Threshold = 0;
    cuesQuery.ThresholdCriteria = CuesThresholdCriteria::None;
    cuesQuery.SecurityAccessFlag = CuesSecurityFlag::SpecifiedProfiles;
    cuesQuery.AdditionalValFunc = CuesAdditionalValFunc::None;
    cuesQuery.AdditionalValField = " ";
    cuesQuery.AdditionalValTable = " ";

    if (cuesQuery.validateWrite())
        info(strfmt("Cue %1 Created with SecurityRights as %2",cuesQuery.CueId,cuesQuery.SecurityAccessFlag));


How to Create new Role Center in DAX 2009

Role center is  EnterPrise Portal Page which is used to show data , reports, pending activities and awaiting actions as per user role in the company.
Means whenever ax starts User will get homepage where he will see the data as per his role in the organization and can be personalized further to suit his requirements.
In order to have this feature available one should install and configure EP on his/her machine/server.
 After Installation do following steps,
  1.  Once you done with RoleCenter and EP installation ,
  2.  Go to Basic->Setup->RoleCenter-->Initialize Role Center will get some default profiles 
  3.  Admin-->Setup->User Profiles , click button Import and select from AOT
  4.  Default profiles (Role Centers) will be imported and You can start using by adding your userid to that select profile.
  5. Restart the AX Client and wait till default Home Page get load.

In Order to Create New RoleCenter in DAX 2009 , Have a look in following snap..

As shown in the figure, nodes under Develop the content are different components that are used to represent various data like SSRS Report , OLAP Cube for Data in BarChart etc.                      
It doesn't mean that all these are mandatory steps while creating new role center. For testing purpose just make use of Cue as specified in below image.

  Enjoy with your new role center !!!!!!!

View Embedded Resources in Ax

In DAX 2009 we have provision to view the existing resources like icons,images that are used on User Interfaces.
System will display all the resources with their Resource Id and image type. So whenever you want to display images and don't know the id then go for embedded resources as show in following snap.

Path : Tools-->Development tools-->Embedded Resource