Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

(0) ShareShare
ReportReport
Posted on by

Hi all,

I am unable to update fields inventsiteid  and inventlocationid in inventdim table.

Merely I tried updating other fields in inventdim table n m successfully able to it is only when I try to update fields inventsiteid and inventlocationid am not able.

I wrote a job . Am not getting any error . But after executing the job when I check the table browser the changes are not reflected.

Kindly let me know how can I do this.

The reason for this in client's prod environment an user manually changed the inventsiteid at line level

*This post is locked for comments

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    Hi axMani, unfortunately I don't know how to solve it, you should talk with a functional consultant. Many times in AX you can't edit the information on the order if dependent processes have been started - or finished.

    But now you know how to update the information in code. Now you have to deal with the next problem and understand why you can't update those fields on these specific orders (in code or manually).

  • Community Member Profile Picture
    on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    Nikolaos,

    I think that I should have to move the stock from one site and ware house to the required site and warehouse.

    Was it something for which the error pops for ?

    Please guide me. I have checked the URL u have suggested and the idea as said above

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    Maybe you could find help from here: community.dynamics.com/.../54600

  • Community Member Profile Picture
    on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    Hi Nikolaos,

    I am.getting the following error.

    " Inventory dimension Site must be consistent within the lot,so it cannot be changed.

    Update has been cancelled ".

    Any idea why ?. Do I have to change any parameter.

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    You don't have to select InventDim.

    Instead just instantiate a new buffer, give the dimensions that you want and then use the findOrCreate method. It will look for an existing InventDim record with those values, or create a new record if needed.

    But the SalesLine you will have to select with your own criteria (which lines you want to update).

  • Community Member Profile Picture
    on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    Thank u so so much Nikolaos.

    Just one more doubt. I have to select to select the inventdim table with required innventdimid and salesline with required salesid right ?. Along with the code u have sent

  • Suggested answer
    István Orosz Profile Picture
    2,137 on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    Hi,

    InventDim is an important table in AX, it is not recommended to update this directly. If you want to do it anyway, you should use inventDim.update(true). You can refer to this topic if more information is needed:

    How to delete from / update "InventDim" table with X++

    Kind regards,

    István

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    If the user changed invent location and invent site on the sales orders, you should absolutely not update InventDim table! InventDim table contains all used combinations of inventory dimensions. And in SalesLine, InventDimId is a link which points to the correct combination for that line. If you change InventDim, all orders which use that InventDImId will break.

    Instead you have to change the InventDim of the order lines that you want to change.

    For example:

    inventDim.clear();
    inventDim.InventSiteId = "mySite";
    inventDim.InventLocationId = "myLocation";
    
    ttsbegin;
    salesLine.selectForUpdate(true);
    salesLine.inventDimId = InventDim::findOrCreate(inventDim).InventDimId;
    salesLine.update();
    ttscommit;


  • Community Member Profile Picture
    on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    Hi Nikolaos,

    Thanks for your reply.

    User did not change them in the table browser. Instead they have changed them while the sales order was in the created state (Front End)

    is it not possible to change them via a job ? Please suggest

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Unable to update inventsiteid and inventionlocationid in inventdim table ax 2012

    On what "line level" the user changed those values? Do you mean that the user changed values in InventDim table using the table browser?

    If yes, you could use the same process to change them back, right?

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
shanawaz davood basha Profile Picture

shanawaz davood basha 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans