Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

How to add Product Category to Sales Line AX 2012?

Posted on by 1,811

Hii,

Version: AX 2012 R2.

I have a custom form with grid control.

Data sources are SalesTable, SalesLine, InventTable with InnerJoins.

The purpose is to show open sales lines and product related information for analysis.

On this form I want to show sales line Product Category that is in table EcoResCategory.Name .

What tables I need to add in this form data source and relations or is there better way to achieve it?

Thanks

Here is my Custom Form

6014.form.png

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,417 on at
    RE: How to add Product Category to Sales Line AX 2012?

    Hi Rana,

    Since you are joining the data sources directly under the form. You can add EcoResProduct and set the join source to InventTable. EcoResProductCategory will be joined to EcoResProduct. EcoResCategory will be joined to EcoResProductCategory. These tables have relationships defined, so you will be able to get the Category name.

  • Rana Anees Profile Picture
    Rana Anees 1,811 on at
    RE: How to add Product Category to Sales Line AX 2012?

    Hii Gunjan,

    "So, you want to find the Product category for the item selected in the sales order line. Correct?" Yes

    One question, on my form datasource I am directly adding tables without designing queries... tables and relations you said are possible without query...

    Thanks

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,417 on at
    RE: How to add Product Category to Sales Line AX 2012?

    Hi Rana,

    So, you want to find the Product category for the item selected in the sales order line. Correct?

    In that case, you can join EcoResProductCategory to InventTable based on

    EcoResProductCategory.Product = InventTable.Product

    Then you can join EcoResCategory to EcoResProductCategory based on  EcoResCategory.RecId = EcoResProductCategory.Category

  • Rana Anees Profile Picture
    Rana Anees 1,811 on at
    RE: How to add Product Category to Sales Line AX 2012?

    Hii Gunjan,

    In our database SalesCategory field in SalesLine table is all set to 0. Maybe not using this option.

    Can you please guide how to get it from Product.

    Thanks

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,417 on at
    RE: How to add Product Category to Sales Line AX 2012?

    Hi Rana Anees,

    If you want to display the category name only, you can use the field "SalesCategory" as a reference group as in SalesTable form. 

    pastedimage1603894130824v1.png

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,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans