cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

UomEntry in ITM12 is created with not aspected value

RiccardoSuprani
Discoverer
0 Likes
316

In UGP1 I have a group with code = 1, and 5 unit of measure

RiccardoSuprani_1-1737810336992.png

With this code, I create a new Item

 

Items item = ((Items)(myCompany.GetBusinessObject(BoObjectTypes.oItems)));

item.ItemCode = "NewCode";
item.ItemName = "Item NewCode";
item.UoMGroupEntry = 1;
item.UnitOfMeasurements.UoMType = ItemUoMTypeEnum.iutInventory;
item.UnitOfMeasurements.UoMEntry = 5;
int retCode = item.Add();
if (retCode != 0)
{
    string retStr;
    myCompany.GetLastError(out retCode, out retStr);
    Assert.Fail("Item record not insert: " + retStr);
}
Assert.AreEqual(0, retCode);

System.Runtime.InteropServices.Marshal.ReleaseComObject(item);
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(item);

 

When I try to excecute this code, in OITM I found a new record with ItemCode = "NewCode", but the value in ITM12 on the field UomEntry is 1 (not 5).

RiccardoSuprani_0-1737810092133.png

Why is the UomEntry field not valued at 5, as required by my code?

 

Thanks

Riccardo

Accepted Solutions (0)

Answers (1)

Answers (1)

williamwachholz
Active Participant
0 Likes

Hello,

 

Try to set value to the other fields, like Height and HeightUnit.

Please let me know if it worked.

 

Best regards

RiccardoSuprani
Discoverer
0 Likes
No change. The behavior is always the same