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

Update InventoryPosting using DIAPI Error : [OIQR.Series] , 'Field cannot be updated (ODBC -1029)'

former_member807459
Discoverer
0 Kudos
542

Hi Experts!

For one of our project requirement, we are implementing Inventory Counting service in our application & we are making calls using DIAPI. When we perform the Add operation on Inventory Counting we are getting an error as:

Internal error (-5002) occurred

We are using SAP B1 V10 with respective DIAPI. We able to connect to the SAP B1 instance/server using DIAPI but when performing add we are getting error.

Here is the sample code for Add :

SAPbobsCOM.Company _company = new SAPbobsCOM.Company();

_company.Server = @"ServerURL";

_company.CompanyDB = "CompanyDatabase";

_company.UserName = "username";

_company.Password = "password";

_company.LicenseServer = "licenseServer";

_company.language = (SAPbobsCOM.BoSuppLangs)

Enum.Parse(typeof(SAPbobsCOM.BoSuppLangs), "ln_English_Gb");

_company.DbServerType = (SAPbobsCOM.BoDataServerTypes)

Enum.Parse(typeof(SAPbobsCOM.BoDataServerTypes), "15");

_company.DbUserName = "DBUser";

_company.DbPassword = "DBPassword";

int returnVal = _company.Connect();

SAPbobsCOM.CompanyService oCS = (SAPbobsCOM.CompanyService)_company.GetCompanyService();

SAPbobsCOM.InventoryPostingsService oIPS = oCS.GetBusinessService(SAPbobsCOM.ServiceTypes.InventoryPostingsService);

SAPbobsCOM.InventoryPosting oIP = oIPS.GetDataInterfaceFromXMLFile("c:\\Temp\\UserXML.xml");

SAPbobsCOM.InventoryPostingsService oInventoryPostingsService = oCS.GetBusinessService(SAPbobsCOM.ServiceTypes.InventoryPostingsService);

SAPbobsCOM.InventoryPostingParams oInventoryPostingParams = oIPS.GetDataInterfaceFromXMLFile("c:\\Temp\\SampleDataParams.xml");

SAPbobsCOM.InventoryPosting oInventoryPosting = oInventoryPostingsService.Get(oInventoryPostingParams);

oInventoryPostingsService.Update(oIP);

Please suggest a solution for this error. Thank you in advance!

Accepted Solutions (0)

Answers (0)