Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Form InventOnhandItem InventDimId

Posted on by 455

In my situation I need to display a field from InventItemLocation on the InventOnhandItem grid so I created a display method on InventSum datasource, the InventItemLocation find method requires itemId AND InventDimId as parameters. I see there are both ItemId and InventDimId in InventSum datasource but InventDimId always blank. I tried to pass inventDIm.InventDimId as someone suggested using joinChild() method but no luck it is always null or empty.

Any suggestions ?

*This post is locked for comments

  • Verified answer
    Samy123 Profile Picture
    Samy123 455 on at
    RE: Form InventOnhandItem InventDimId

    thanks Boye for your reply but I need to return a record from InventItemLocation Table. for that I need InventDimId.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Form InventOnhandItem InventDimId

    what I did was create the display method on inventdim table:

    display boolean X()

    {

       return WMSLocation::find(this.wMSLocationId, this.InventLocationId).someField;

    }

    then put this displaymethod on the form InventOnhandItemListPage.

    It worked fine.

  • Samy123 Profile Picture
    Samy123 455 on at
    RE: Form InventOnhandItem InventDimId

    the inventLocationId field is visible on the grid I have made it to stay visible on the Grid. But still no luck.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Form InventOnhandItem InventDimId

    Had this same issue a few weeks ago. What you need to do is make your field dependable on the visibility of the inventlocationId field. (it will only be visible and enabled if the inventory dimension is selected). Your field only makes sense if the inventlocationid is visible.

  • Samy123 Profile Picture
    Samy123 455 on at
    RE: Form InventOnhandItem InventDimId

    Ok so here is the situation

    There is a requirement to display a custom field called deptLocation from InventItemLocation table on to the InventOnhandItem Grid. this custom field gives information about specific depts. against itemid, configid and warehouse. I am trying to display the value of this field on the grid using a display method. The InventItemLocation table find method require ItemId and InventDimId to get the correct record. in my display method on InventSum dataSource of the form I am trying to supply itemId and inventDimId from inventSum to the find method but it returns exception that method is called with illegal values because the inventDimId is always null. the line of code looks like this.

    InventItemLocation::Find(_inventSum.ItemId, _inventSum.InventDimId);

    as an alternate I tried following on someone's suggestion

    _InventDim = _inventSum.joinChild();

    InventItemLocation::Find(_inventSum.ItemId, _inventDim.InventDimId);

    But still get the same error and same situation.

    Hope that clarifies your question. Let me know if more information is needed.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: Form InventOnhandItem InventDimId

    To answer thay question, you need to provide some more information about the level of detail in the InventItemLocation table and which field you want to display. Maybe there is something to achieve when you can make some assumptions.

  • Samy123 Profile Picture
    Samy123 455 on at
    RE: Form InventOnhandItem InventDimId

    I see.

    So there is no way I can display a custom field from InventItemLocation on this grid?

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: Form InventOnhandItem InventDimId

    Hi Samy,

    This form is build using some grouping of data. The InventDimId field is used here. If you have e.g. Site and warehouse enabled and you specified to see only on hand on Site level, the InventDimId is not used known as it is a summation of multiple records with different InventDimId's. So linking on the InventDimId of the InventSum datasource is not possible.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans