Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Reference Groups

Posted on by 2,430

I would like to know what Reference group is all about. 

I know Reference groups used for populating look ups but we still have different way to pursue it.

What is the specific use of Reference Group which makes it unique from other.

  • Ann2015 Profile Picture
    Ann2015 1,120 on at
    RE: Reference Groups

    Hi Andre,  Is there anyway I can get the table id where the field Project manager is coming from?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Reference Groups

    I have uploaded a video regarding different uses of reference group.

    Reference Group in AX 2012

    Use of Surrogate key to implement reference group in AX 2012

     

    Table of Contents

    1 Overview

    2 Reference group

    3

     

     

    1. 1.    Overview   

    This document provides all step required to implement reference group using surrogate key.

    1. 2.    Reference group

    In AX 2012, Table relations are based on Surrogate key i.e. Rec-id. With this change, reference group is introduced on AX-forms to display as well as filter records from related table. To know more about Reference group, please go through link:

    Let’s take example to explain & implement it using below steps:

    Consider two tables: ParentTable, ChildTable

     

    Parent table

     

    Child table

     

     

     

    ParentId

     

    ChildId

    ParentName

     

    ChildName

    ParentCity

     

    ChildCity

     

     

    ParentTable (RecId)

    Primary index and cluster index is set as Surrogate key for both tables. Primary key based relation is created on child table. Following Indexes are created and Replacement key for parent table is set as ‘ParentIdx’.

     7573.4.JPG

    2703.2.JPG

     

    4760.3.JPG

    New form is created ‘Child table’, In DataSource node added ‘child table’ and in Reference data source node added ‘Parent table’.

    7573.4.JPG

    Expand design node, drag and drop fields from child table and parent table. Create one reference group filed and provide below properties.

    6835.5.JPG

    Under reference group, ParentId will be shown. This behaviour is the result of replacement key of parent table.

    Replacement key updates the AutoIdentification field group of table.

    Open form, try to create record for child table. Though relation is based on surrogate key selection is provided for ParentId of parent table as shown in figure. On selection related attributes of parent table are shown and available to filter records as well.

    0640.6.JPG

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,430 on at
    RE: Reference Groups

    Thanks Martin for your Patience......

    I resolved that issue.....

    Many thanks to you.............

  • Martin Dráb Profile Picture
    Martin Dráb 225,864 Super User on at
    RE: Reference Groups

    I still have the same question as before.

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,430 on at
    RE: Reference Groups

    You demonstrate one Example in your blog on Replacement Groups.

    My Questions is, Is there any alternate method to do the same Example of yours?

    It's a part of my R&D.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 225,864 Super User on at
    RE: Reference Groups

    What and why would you like to do differently? What problem do you want to solve by the theoretical alternate method?

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,430 on at
    RE: Reference Groups

    I did the same thing which you specified in the Note, surrogate key as primary key and EmplId as alternate key, ReferenceGroup Control present in Form & when you add it, you have ReplacementFieldGroup property associated with it, here we can select table field groups( AutoIndentification & manually Created Field Groups).

    So, Instead of creating like this, Is there any alternate method to populate Replacement keys on Foreign key Table?

    hope you got my question

     

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 225,864 Super User on at
    RE: Reference Groups

    Sorry, it's not clear to me what your problem is. You described how you created a reference group by dragging a field, which is exactly the same approach as used in my article. Then you talk about selecting ReplacementFieldGroup, but it's not clear what problem you have with doing the same with your newly created reference group.

    Note that I would expect you to have the surrogate key as the primary key and EmplId as the alternate key. Having an alternate key the same as the primary one doesn't make much sense to me.

    (By the way, you should use the worker table in any real implementation, instead of creating a new table with the same purpose.)

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,430 on at
    RE: Reference Groups

    Hi Martin,

    One Small doubt that has to be clarified and I will demonstrate with an example.

    I created two tables e.g., BaseTable & DerivedTable, the fields in BaseTable(EmpId, Name, DOB) and in Derived Table(TotalHourWorked, TotalAmountCharged).

    EmpId is primary key in BaseTable, in table properties, I assign Replacement Key =  PrimaryIdx (Alternate key = Yes in Index properties of BaseTable).

    In DerivedTable, I created Foreign key (Primary key based) based Relation, It added the BaseTable field with same name as Table Name which of type Int64, till here, It's OK but when I dragged this field in form-> Design->Designs node, It became type of Reference Group (I am not Emphasizing on contents of Form) 

    My questions is, Can't I get this same feature as simple as same above in another way?

    You did this same thing in your post in more simpler way by just selecting ReplacementFieldGroup.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 225,864 Super User on at
    RE: Reference Groups

    Just for reference, I also tried to explain reference groups on my blog.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans