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)

Inventory Table Default Dimension Update

(0) ShareShare
ReportReport
Posted on by 2,147

Hello,

I wrote a class in AOT that imports default dimension into inventory items.  The dimension was updated and shows on the AX table.  Except it is not showing on SQL server table or in AX application.  Is there another step I am missing. I synchronized the InventTable but it did not work.  Any help would be appreciated.

Thanks,

Tremor

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at

    Hi Tremor,

    Can you elaborate? What do you mean with it shows on AX table but not on SQL server? Can you share some examples and your coding? I assume you used the standard DefaultDimension field which is available on the InventTable table?

  • Tremor Olaes Profile Picture
    2,147 on at

    When I open the InventTable in AOT, the financial dimensions show on the table rows.  When I log into AX to look at the record, the financial dimension does not show up.  After updating the sql table InventTable, the financial dimension shows up now.  Yes, I updated the DefaultDimension field.  

  • Tremor Olaes Profile Picture
    2,147 on at

    I will share the code as soon as I get a chance.

  • Tremor Olaes Profile Picture
    2,147 on at

    This is the method I am using:

    private void updateInventoryDimension(ItemId _itemid, DimensionDefault _dimension)

    {

       //AssetTable                  assetTable;

       InventTable                 inventtable;

       boolean                 lineexists;

       try

       {

           ttsBegin;

           while select forUpdate inventtable

                   where inventtable.ItemId == _itemid

           {

               lineexists = true;

               inventtable.DefaultDimension = _dimension;

               info(strFmt("Updated Inventtable with itemid: %1, Item : %2, Dimension", _itemid, _dimension));

           }

           ttsCommit;

          if(!lineexists)

           {

               warning(strFmt("Could not find Item :  %1, Item : %2, Dimension", _itemid, _dimension));

           }

       }

       catch(Exception::Error)

       {

           error(strFmt("Error Updatiing Item :  %1, Item : %2, Dimension", _itemid, _dimension));

       }

    }

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Tremor Olaes,

    You forgot to call "update" to save changes, so it should be 

        ttsBegin;
    
        while select forUpdate inventtable
            where inventtable.ItemId == _itemid
        {
           lineexists = true;
    
           inventtable.DefaultDimension = _dimension;
           inventtable.update();
               
    info(strFmt("Updated Inventtable with itemid: %1, Item : %2, Dimension", _itemid, _dimension)); }
    ttsCommit;
  • Tremor Olaes Profile Picture
    2,147 on at

    OMG!  I cannot believe I left that out.  I actually must have deleted it.  Thanks Ievgen!!

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