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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

InventItemPrice Form

(0) ShareShare
ReportReport
Posted on by

Hi I want to add a filter on the InventItemPrice form.  I want to filter by ItemGroupId from the InventItemGroupItem Table.

What's the best way to do this?

Thanks in Advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Could you provide some more details about your requirement as the form InventItemPrice form has two tabpage Active prices & Pending prices and do you want to display even the itemgroupId on the form. If so, you need to add the table InventItemGroupItem to the form with the joinSource as ItemPriceActivated and LinkType InnerJoin. In the init method of the datasource InventItemGroupItem add the following statement

    Path: \Forms\InventItemPrice\Data Sources\InventItemGroupItem\Methods\init

    public void init()
    {
        super();
        
        this.query().dataSourceTable(tableNum(InventItemGroupItem)).addLink(fieldNum(InventItemPrice, ItemId), fieldNum(InventItemGroupItem, ItemId));
    }

    Add the field to the tabpage Overview under Active to see the value for ItemGroupId.

    Path: \Forms\InventItemPrice\Designs\Design\[Tab:Tab]\[TabPage:Activated]\[Group:GroupActivated]\[Tab:TabActivated]\[TabPage:OverviewActivatedPrices]\[Grid:GridActive]

  • brianmaric Profile Picture
    on at

    Hi Thank You...I just need it on ItemPriceSimulated and where do you put the filter for the item group?

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Process I explained helps to create a itemGroupId fied on the grid(of Active prices tab page) such that you can filter it, if you want it on the Pending price tab(in overview tabpage grid) then use joinsource as  ItemPriceSimulated and in the init method of table InventItemGroupItem your code would be like below. Let me know if anything is missing.

    public void init()
    {
        super();
        
        this.query().dataSourceTable(tableNum(InventItemGroupItem)).addLink(fieldNum(InventItemPriceSim, ItemId), fieldNum(InventItemGroupItem, ItemId));
    }


  • brianmaric Profile Picture
    on at

    Hi, one thing I don't understand.   If we specify the relation to be 'inner join', then why do we need to use the 'addlink' function?

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    As there is no relationship between InventItemPriceSim and InventItemGroupItem, I used addLink method to explicitly mention the link, you can give a try without addLink method.

  • brianmaric Profile Picture
    on at

    Now when I try to add a record, I get an error saying I need to add the Item Number.

  • brianmaric Profile Picture
    on at

    Ok, I just needed to set the relation to 'Exists' and it works

    Thanks!

  • brianmaric Profile Picture
    on at

    strange...did not work...but thanks

  • Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    If you change it to existsJoin, is it working or not?

  • brianmaric Profile Picture
    on at

    Yes it works it I change it to an existsJoin...

    ...funny though how the link needs to specified twice: once through specifying the existsjoin and also using the addlink Method in code...but yeah it works...thanks again

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans