Skip to Content
Apr 02, 2007 at 06:19 AM

Receipt from Production with DIAPI error -2014


After upgrading to 2005 SP1 PL19, Receipt from Production with DIAPI give error -2104.

The function worked fine in 2004. In 2005 SP1 early patches, it gave wrong price (= different from manually created ones) and you actually can't even set the price in DIAPI. Now in the latest patches it does not work at all anymore. Error description is "Internal error (-2014) occurred".

I can manually do the Receipt from Production in SBO, so the problem is only in DIAPI.

Anyone else have the same problem? Any ideas on what to do?

I have tried to set different values in the document (CostingCode, WarehouseCode, etc), but nothing seems help.

Here is the relevant part of the code:

// int baseEntry    - DocEntry of the production order
// double quantity - amount to receipt from production

diDoc = (Documents)B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oInventoryGenEntry);
diDoc.Lines.BaseType = (int)BoObjectTypes.oProductionOrders;
diDoc.Lines.BaseEntry = baseEntry;
diDoc.Lines.Quantity = quantity;
if (diDoc.Add() != 0)
  throw new Exception(B1Connections.diCompany.GetLastErrorDescription());