Tuesday, April 16, 2013

Related Fixed Field Relation in AX 2012


HI friends,


It's not that hard to understand Relation in Dynamics AX 2012. Let me use the same theme as MSDN - Clothing.

Lets say you have 4 tables

1. ClothesTable
2. MenClothesOrder
3. WomenClothesOrder
4. ChildernClothesOrder

Create BaseEnum CollectionTypeId with the following elements:

0 - Men
1 - Women
2 - Children

Create Extended DataType CollectionTypeEDT of BaseEnum CollectionTypeId. Now use this EDT in your ClothesTable.

ClothesTable has the following fields:

1. ClotheId,
2. Name and
3. CollectionTypeId

MenClothesOrder, WomenClothesOrder and ChildernClothesOrder has the following fields:
1. OrderId,
2. ClotheId,
3. Qty

Case 1:

On MenClothesOrder we create a new relation to ClothesTable and specify the follwing two relations:

1. Normal = ClotheId to ClotheId and

2. Related Fixed Field 0 = ClothesTable.CollecTionTypeId. and SourceEDT = CollectionTypeEDT


This shows that the lookup to the clothes table should show only clothes with the same ClotheId (Define in Normal Relation) AND clothes that are of type Men (Define in Related Fixed Field Relation) because the our table deals with order for mens' clothes. We use 0 because Men is element 0 in the Enum.

Case 2:


On WomenClothesOrder we create a new relation to ClothesTable and specify the follwing two relations:

1. Normal = ClotheId to ClotheId and

2. Related Fixed Field 1 = ClothesTable.CollecTionTypeId. and SourceEDT = CollectionTypeEDT


This shows that the lookup to the clothes table should show only clothes with the same ClotheId (Define in Normal Relation) AND clothes that are of type Women (Define in Related Fixed Field Relation) because the our table deals with order for Womens' clothes. We use 1 because Women is element 1 in the Enum.

Case 3:


On ChildernClothesOrder we create a new relation to ClothesTable and specify the follwing two relations:

1. Normal = ClotheId to ClotheId and

2. Related Fixed Field 2 = ClothesTable.CollecTionTypeId. and SourceEDT = CollectionTypeEDT


This shows that the lookup to the clothes table should show only clothes with the same ClotheId (Define in Normal Relation) AND clothes that are of type Childern (Define in Related Fixed Field Relation) because the our table deals with order for Childern's clothes. We use 2 because Childern is element 2 in the Enum.

Hope it will help you to understand Related Fixed field Relation in Dynamics AX.........

Happy DAXing...... :)

Sample XPO Link :
https://docs.google.com/file/d/0B7UC6CtWeBQTeW9MY0hqZE5BejQ/edit?usp=sharing


1 comment:

  1. Hello Pankaj,

    This Post is very Help full for Every one very nice explanation and can you please Detail Field Fixed Relation as well.

    Raghunath Chintala

    ReplyDelete

Enable UAT database over OneBox DevTest environment using JIT

 Dear Friends, In this Article I will show you how to enable UAT database access for Development machine using just-in-time (JIT). Many time...