on 2025 Jan 25 1:13 PM
In UGP1 I have a group with code = 1, and 5 unit of measure
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).
Why is the UomEntry field not valued at 5, as required by my code?
Thanks
Riccardo
Request clarification before answering.
Hello,
Try to set value to the other fields, like Height and HeightUnit.
Please let me know if it worked.
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 27 | |
| 13 | |
| 11 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.