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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

get Invent Site (InventSiteId ) from WareHouse and Item by Code X++

(0) ShareShare
ReportReport
Posted on by

Hi all ! I want get auto InventSiteId for WareHouse  ! On Grid , when I select WareHouse then auto get Invent Site of Item. ( I set Default Order settings InventSite and Warehouse for item). Help me by code or solutions. Thanks all !

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Pravasti AK Profile Picture
    2,985 on at
    RE: get Invent Site (InventSiteId ) from WareHouse and Item by Code X++

    Hi Nguyen,

    static void _GetInventoryDimensions(Args _args)

    {

       InventTable                 inventTable = inventTable::find('Dxxxx);

       InventItemOrderSetupType    setupType   = InventItemOrderSetupType::Invent;

       InventDim                   inventDim;

       ;

       // Default Site

       inventDim.InventSiteId = inventTable.inventItemOrderSetupMap(setupType).inventSiteId(inventDim.InventSiteId, inventTable);

       // Default Location

       inventDim.InventLocationId  = inventTable.inventItemOrderSetupMap(setupType,

                                                                         InventDim::findOrCreate(inventDim).InventDimId)

                                                                         .inventLocationId(inventDim.InventLocationId,

                                                                                           inventTable,

                                                                                           inventDim.InventSiteId);

       // Default ConfigId

       inventDim.ConfigId = inventTable.StandardConfigId;

       // Find Default Item Dimension

       inventDim = InventDim::findOrCreate(inventDim);

       info(strFmt('Invent Dim. Id: %1', inventDim.inventDimId));

       info(strFmt('Site Id: %1', inventDim.InventSiteId));

       info(strFmt('Warehouse Id: %1', inventDim.InventLocationId));

    }

  • Community Member Profile Picture
    on at
    RE: get Invent Site (InventSiteId ) from WareHouse and Item by Code X++

    Thanks Kavitha Rajan ! but I need find InventSiteId with parameter is InventLocationId. I need auto display InventSiteId  on Grid when I select InventLocationId on a record ! help me a method !

  • Mea_ Profile Picture
    60,284 on at
    RE: get Invent Site (InventSiteId ) from WareHouse and Item by Code X++

    Try this:

    InventSiteId inventSiteId = InventLocation::find('myInventLocationId').InventSite().inventSiteId;


  • Suggested answer
    Pravasti AK Profile Picture
    2,985 on at
    RE: get Invent Site (InventSiteId ) from WareHouse and Item by Code X++

    Hi Nguyen,

    if (inventDim.InventSiteId)

    {

    inventLocationId  = inventTable.inventItemOrderSetupMap(InventItemOrderSetupType::Sales,

    InventDim::findOrCreate(inventDim).InventDimId).inventLocationId(inventDim.InventLocationId,

    inventTable,

    inventSiteID);

    print inventLocationId;

    pause;

    }

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans