web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Adding a field to a grid which references another table

(0) ShareShare
ReportReport
Posted on by

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.

*This post is locked for comments

  • Verified answer
    Kumar Gaurav @ MS Profile Picture
    on at

    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.

  • Community Member Profile Picture
    on at

    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
    Martin Dráb Profile Picture
    240,845 Most Valuable Professional on at

    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
    on at

    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
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi

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

  • Community Member Profile Picture
    on at

    Thank you Denis...that was what I needed

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans