# Updating Inventory Dimensions Value

**URL:** <https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534>\
**Category:** Developer Forum\
**Created:** [May 30, 2017, 11:34am UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534 "2017-05-30T11:34:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![We\_key02](https://avatars.discourse-cdn.com/v4/letter/w/bb73d2/32.png) [@We\_key02](https://www.dynamicsuser.net/u/We_key02)\
**Post date:** [May 30, 2017, 11:34am UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/1 "2017-05-30T11:34:27Z")

</div>

Hello,

I am using Ax 2012.

I am trying to update the inventory dimensions value while creating a sales order through x++ code. My job runs without any error and sales order is created with the respective sales line.

But when I check the inventory transactions, Dimensions value is not shown. It fetches the correct DimId value from the InventDim table but still the value is not displayed.

I have used the following Code,

```auto
static void LearningSalesOrderWithInventDim(Args _args)
{
    SalesTable salesTable;
    NumberSeq NumberSeq;
    SalesLine salesLine;
    InventDim inventDim;
    
    // Create the Sales Order
    ttsbegin;
    NumberSeq =NumberSeq::newGetNum(SalesParameters::numRefSalesId(),true);
    salesTable.SalesId = NumberSeq.num();
    salesTable.initValue();
    salesTable.CustAccount = "2002";
    salesTable.initFromCustTable();
    salesTable.insert();

    //Create the Sales Line with the created Sales Order
    salesLine.clear();
    salesLine.SalesId = salesTable.SalesId;
    salesLine.ItemId = "1000";
    salesLine.SalesQty = 3;
    inventDim.clear();
    inventDim.configId = 'Round';
    inventDim.InventSizeId = '01';
    inventDim.InventColorId = '01';
    inventDim.InventStyleId = '01';
    inventDim.inventBatchId = '000001';
    inventDim.InventLocationId = 'VMIW';
    inventDim = InventDim::findOrCreate(inventDim);
    salesLine.InventDimId = inventDim.inventDimId;
    salesLine.CreateLine(NoYes::Yes,
    NoYes::Yes,
    NoYes::Yes,
    NoYes::Yes,
    NoYes::Yes,
    NoYes::Yes);
    ttscommit;
    info(salesTable.SalesId);
}

```

Please check the image below only site and warehouse is getting displayed.

 ![InventoryTransaction.PNG](https://us1.discourse-cdn.com/flex023/uploads/dugusers/original/2X/b/b59ec50644f789cd62e14a49f20355a134c1c738.png)

Thanks

---

<div class="post-metadata">

**Author:** ![kranthi](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@kranthi](https://www.dynamicsuser.net/u/kranthi)\
**Post date:** [May 30, 2017, 11:49am UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/2 "2017-05-30T11:49:44Z")

</div>

Debug and see if the createLine method overrides the inventdimId you are assigning.

---

<div class="post-metadata">

**Author:** ![kranthi](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@kranthi](https://www.dynamicsuser.net/u/kranthi)\
**Post date:** [May 30, 2017, 11:57am UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/3 "2017-05-30T11:57:52Z")

</div>

I would have used, salesLine.setInventDimId(inventDim.inventDimId); to set the inventDimId because it also handles the site dimension link.

---

<div class="post-metadata">

**Author:** ![We\_key02](https://avatars.discourse-cdn.com/v4/letter/w/bb73d2/32.png) [@We\_key02](https://www.dynamicsuser.net/u/We_key02)\
**Post date:** [May 30, 2017, 12:00pm UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/4 "2017-05-30T12:00:31Z")

</div>

Hello Kranthi,

Thanks for your reply. I will check from my side and will get back to you .

Thanks

---

<div class="post-metadata">

**Author:** ![We\_key02](https://avatars.discourse-cdn.com/v4/letter/w/bb73d2/32.png) [@We\_key02](https://www.dynamicsuser.net/u/We_key02)\
**Post date:** [May 30, 2017, 1:00pm UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/5 "2017-05-30T13:00:48Z")

</div>

Hello Kranth!,

I checked and i noticed that the dimId overrides. Can u please tel me what i got to do to avoid it ?

---

<div class="post-metadata">

**Author:** ![kranthi](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@kranthi](https://www.dynamicsuser.net/u/kranthi)\
**Post date:** [May 30, 2017, 1:09pm UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/6 "2017-05-30T13:09:28Z")

</div>

Where does its been overwritten?

---

<div class="post-metadata">

**Author:** ![We\_key02](https://avatars.discourse-cdn.com/v4/letter/w/bb73d2/32.png) [@We\_key02](https://www.dynamicsuser.net/u/We_key02)\
**Post date:** [May 30, 2017, 1:36pm UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/7 "2017-05-30T13:36:13Z")

</div>

[c] \Classes\Info\add 1  
[s] \Classes\xRecord\doInsert  
[s] \Classes\SalesLineType\insert 100  
[s] \Data Dictionary\Tables\SalesLine\Methods\insert 15  
[s] \Data Dictionary\Tables\SalesLine\Methods\CreateLine 116  
[c] \Jobs\LearningSalesOrderWithInventDim 31

---

<div class="post-metadata">

**Author:** ![kranthi](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@kranthi](https://www.dynamicsuser.net/u/kranthi)\
**Post date:** [May 30, 2017, 1:54pm UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/8 "2017-05-30T13:54:17Z")

</div>

You are not filling the site, try by filling it.

Also check if the item has all the dimensions enabled and check the product variants for that product master. (the dimension that you are assigning in the code)

---

<div class="post-metadata">

**Author:** ![We\_key02](https://avatars.discourse-cdn.com/v4/letter/w/bb73d2/32.png) [@We\_key02](https://www.dynamicsuser.net/u/We_key02)\
**Post date:** [May 31, 2017, 6:11am UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/9 "2017-05-31T06:11:12Z")

</div>

I updated with the site … But still the value overrides.

---

<div class="post-metadata">

**Author:** ![kranthi](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@kranthi](https://www.dynamicsuser.net/u/kranthi)\
**Post date:** [May 31, 2017, 6:22am UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/10 "2017-05-31T06:22:39Z")

</div>

Check if you can create the sales line manually with those dimensions.

---

<div class="post-metadata">

**Author:** ![We\_key02](https://avatars.discourse-cdn.com/v4/letter/w/bb73d2/32.png) [@We\_key02](https://www.dynamicsuser.net/u/We_key02)\
**Post date:** [May 31, 2017, 7:26am UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/11 "2017-05-31T07:26:19Z")

</div>

Hello Kranth!,

I tried doing manually and I couldn’t able to update with my dimensions value. I ll try creating a new product and try to update and get back to you with the scenario. Meanwhile if got any suggestions tell me please.

Thanks

---

<div class="post-metadata">

**Author:** ![kranthi](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@kranthi](https://www.dynamicsuser.net/u/kranthi)\
**Post date:** [May 31, 2017, 7:55am UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/12 "2017-05-31T07:55:37Z")

</div>

> [@](#):
>
> I couldn’t able to update with my dimensions value.

May be the product variants are not released.

[technet.microsoft.com/…/hh545538.aspx](https://technet.microsoft.com/en-us/library/hh545538.aspx)

---

<div class="post-metadata">

**Author:** ![We\_key02](https://avatars.discourse-cdn.com/v4/letter/w/bb73d2/32.png) [@We\_key02](https://www.dynamicsuser.net/u/We_key02)\
**Post date:** [May 31, 2017, 7:58am UTC](https://www.dynamicsuser.net/t/updating-inventory-dimensions-value/63534/13 "2017-05-31T07:58:53Z")

</div>

Hello Kranthi,

Thanks for your help it worked with the new product.

Thanks.
