cancel
Showing results for 
Search instead for 
Did you mean: 

Update Cancellation Invoice with DI API

414

Hi
I am trying to update an Invoice Cancellation after it has been added. I did this to edit the Comments of an existing Invoice and it worked but just not with a Cancellation

int nErr;
string errMsg;
int RetVal;
SAPbobsCOM.Documents mDoc =(SAPbobsCOM.Documents) mCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
mDoc.GetByKey(3923);
//change a few fields
RetVal = mDoc.Update();
if (RetVal != 0)
{
   mCompany.GetLastError(out nErr, out errMsg);
   MessageBox.Show(errMsg, "ok");
}

The Key I am using belongs to a Cancellation which I am using as an example.

This always results in the following error even if I don't change anything:

'13' is not a valid value for property 'BaseDocType'. The valid values are: '-1' - '', '0' - '', '23' - 'Sales Quotation', '17' - 'Sales Order', '15' - 'Delivery'

Regards

View Entire Topic
Esti
Explorer
0 Kudos

Hi Alexander,

I am using SAP Business One 10 FP2111 and I found the same error. How did you solve it?

Thanks,

Esti.