Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Sites and Warehouses

Posted on by Microsoft Employee

Hi everyone.

I'm trying to get ALL the Sites and/or Warehouses of a particular item by just showing them in the infolog. But I can't seem to understand where these info should come from. I'm new to AX. I learned that products can be found in EcoResProduct or InventTable. And Site/Warehouse in the InventDim/InventLocation. But I can't get how these two are related (even though I looked for each table's rerlations. I didn't find any, as far as I've tried to)

And I can't seem to find any reliable/exact help online. If you have insights on this, please tell me. Anything is appreciated. Thanks!

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sites and Warehouses

    This is what I'm trying to look for! Thanks so much Rustem!

  • Verified answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Sites and Warehouses

    As you know, you can specify storage and tracking dimensions on item, but values of sites, warehouses and overs you can specify when you want to buy, sell, transfer (as example) items. When you create sales line you specify inventory dimension and system generate InventDimId value and record (if it's not exists) in inventDim table. Also when you specify sales qty system generates records in InventTrans table which has information about Item and InventDimId (reference to InventDim table). When you post invoice, or make reservation of Items system generate record in InventSum table which also has information about Item and InventDimId.

    So, if you want to get information about Items and inventory dimensions, just select it from InventTrans or InventSum tables and join InventDim table.

    static void Job177(Args _args)
    {
        InventTrans inventTrans;
        InventDim   inventDim;
        Counter     i;
        
        while select inventTrans
            group by ItemId, InventDimId
        join inventDim
            group by InventSiteId, InventLocationId
            where inventDim.inventDimId == inventTrans.inventDimId
        {
            i++;    
            info(strFmt("%1 - %2 - %3", inventTrans.ItemId, inventDim.InventSiteId, inventDim.InventLocationId));
            
            if (i == 10)
                break;
        }
    }

    static void Job178(Args _args)
    {
        InventTrans inventSum;
        InventDim   inventDim;
        Counter     i;
        
        while select inventSum
            group by ItemId, InventDimId
        join inventDim
            group by InventSiteId, InventLocationId
            where inventDim.inventDimId == inventSum.inventDimId
        {
            i++;    
            info(strFmt("%1 - %2 - %3", inventSum.ItemId, inventDim.InventSiteId, inventDim.InventLocationId));
            
            if (i == 10)
                break;
        }
    }


  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sites and Warehouses

    I just want to show the site/Warehouses an Item has.

    Per se, I have an Item A0001 and it has two sites, 1 and 11. In site 1 it has 12 warehouses, and in site 11, it has 3 warehouses.

    I just want to infolog these details to show the Sites/Warehouses it has. (not concerning the on hand availability or anything, just the site id and location id)

    :) :)

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Sites and Warehouses

    Take a look at this link to understanding of inventory dimensions:

    http://basicax.blogspot.com/2013/03/ax2012-understanding-inventdimid.html

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Sites and Warehouses

    There is no direct connection. Item can be on-hand in the warehouse or may not be, because it has been just created and has never been produced, sold or purchased. So what are you actually doing ?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,316 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans