Thursday, December 29, 2011

WALKTHROUGH - Creating Fact Boxes in AX 2012 - PART III

In my last post (http://axwonders.blogspot.com/2011/12/walkthrough-creating-fact-boxes-in-ax_28.html ), we created 3 EDT’s, 4 tables and created the relationships we needed to hold the Auto Rental data.  In this short post we are going to talk about primary indexes, and then we will create one for the Eduardo_CustCarTable.  In addition, we are going to learn a little bit more about Form’s Parts in AX 2012 before jumping into creating the user interface forms for the Auto Rental data.

Indexes
For detailed information about indexes you can read the following: http://axwonders.blogspot.com/2011/11/indexes-in-microsoft-dynamics-ax.html
In a nutshell, we can say that a primary key is one or more columns that uniquely identify one record in a table from all the other records.  A primary index is a unique index for a table that defines the primary key for that table. To set an index as a unique index, set the index property Allow Duplicates to No. This is the same idea as creating a MS SQL table primary key (Check the following post for more info about this http://blog.sqlauthority.com/2008/09/08/sql-server-%E2%80%93-2008-creating-primary-key-foreign-key-and-default-constraint/).
NOTE: When a primary index is not specified, AX uses a Surrogate Key as the primary index. This key is the RecId field and, if the table is saved per company, the DataAreaId. The surrogate key is used on many relations between tables.
To set the primary index on a table, open the property sheet for the table. The PrimaryIndex property allows any unique index with a key that is mandatory and cannot be edited.

1.       In the AOT, locate the Eduardo_CustCarTable table.


2.       In the property sheet for the table, set the PrimaryIndex property on the table to RentalIdx






Parts
So, what are Parts? [From Microsoft - http://msdn.microsoft.com/en-us/library/gg844683.aspx ]A Part is a specialized type of control you use to retrieve and show a collection of data. A part specifies how to retrieve the data that appears in the FactBox pane of a form, the preview pane of a list page, or the enhanced preview of a control. You use parts to provide information related to a record that appears in a form…

…To create or modify a part, you use the properties of that part to describe how to retrieve and show data. For example, you use a part property to specify the data source for the part. Typically, you use a query as the data source for a part. You also use properties to specify the data fields that show when the part appears as a FactBox on a form.
Then a FactBox is the collection of data that appears on the form, which is based on a Part.  In addition, a FactBox always represents a single part, and if we want to modify a FactBox, we must modify the underlying part.
In AX 2012, a part is defined by using metadata and each part we create extends a common metadata model for parts. Further, one of the best advantages of the Part metadata model is that enables us to create parts that can appear in both the client and Enterprise Portal (EP).
Parts also allow us to represent data through cues in AX 2012. To show a cue in the FactBox pane of a form, you add the cue to a cue group part. A cue group is a type of part that contains one or more cues, and these can be created as a cue group that can appear in forms for both the client and EP, which can be used to add information to a role center page.
In my next and last post about this topic, we will create the user forms needed to display the Auto Rental data. In addition, we will create menu items, and of course a FactBox to display Auto Rental information related to a customer.


Take Care!

5 comments:

  1. Great post -- really helpful summary of the one the most exciting new features of AX 2012. Thanks!

    ReplyDelete
  2. Touche. Outstanding arguments. Keep up the great work.
    My webpage: mcallen web design

    ReplyDelete
    Replies
    1. Thanks so much for readin my blog and your refreshing comment. It is much appreciate it.

      Delete
  3. Hello, I would like to subscribe for this blog to get latest updates, therefore where can i do it please help out.
    My web site - Posted by My Industrial Injury Claims.com

    ReplyDelete
    Replies
    1. Hi,

      Thanks so much for reading my blog. You can join the site by clicking the button "Join thi site" un the followers section on the right column. You will need to have either a google, twitter and/or yahoo account.

      I hope this helps!

      Delete

Thank you for your thoughts. Your comment will appear in my blog shortly after review.

Have a great day!