Skip to main content

Notifications

Microsoft Dynamics AX forum
Answered

Adding a field to a grid which references another table

Posted on by Microsoft Employee

Hello all!

I'm attempting to add a field to the WMSBillOfLading grid which will reference CustPackingSlipJour.PackingSlipId. How is something like this typically done? Is there a form "load" event/method where code could be called? I didn't want to duplicate the data by adding it to WMSBillOfLading table. Thanks in advance.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Adding a field to a grid which references another table

    Thank you Denis...that was what I needed

  • Verified answer
    Denis Macchinetti Profile Picture
    Denis Macchinetti 16,444 on at
    RE: Adding a field to a grid which references another table

    Hi

    As per my knowledge, the relation between CustPackingSlipJour and WMSBillOfLading is made by CustPackingSlipJour.BillOfLadingId = WMSBillOfLading.BillOfLadingId

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Adding a field to a grid which references another table

    I now have a table relationship question between WMSBillOfLading and CustPackingSlipJour. I was going to use sales order id to link them but quickly found it's a many to many relationship. Anyone know what the relationship is between those two tables if I'm looking for the packing slip for a given bill of lading? Thanks much.

    Btw, please ignore the previous post, I discovered how to use the display method.

    Thank you.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 227,996 Super User 2024 Season 2 on at
    RE: Adding a field to a grid which references another table

    You can just put data directly to a grid cell. The grid is bound to a data source, so you have to bind every column either to a field or to a display method.

    If you need data from several data sources in the same grid, simply join them together, bind the grid to the parent data source and use fields from several data sources in the same as you do now with a single data source.

    Display methods are explained in Using the display Method Modifier.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Adding a field to a grid which references another table

    Kumar, just to clarify, I would create a display method on WMSBillOfLading which will do the lookup between WMSBillOfLading and CustPackingSlipJour. Then use the display method to load the field on the grid?

    Within the display method how do I reference the WMSBillOfLading object in order to retrieve the SalesId?

    Thanks very much!

  • Verified answer
    RE: Adding a field to a grid which references another table

    You can create a display method to achieve this, in case you want sort , search to work on the field then see if there is relationship between these two tables or if you can make one. Then you can add your table in data source of form and display the field.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,186 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,996 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans