Hi,
Now I have an issue in my DI App to update a invoice document status to Printed when the BP is inactive. When I try to update the document then I get an error from DI, the error code is -10 and the error message is "10001071 - Customer XXX is inactive". The interesting thing is I can print the document in SAP client and the document status can be changed to Printed even the BP is inactive. So I am wondering if there is something not right in my DI App when trying to updating the document status? See below my code in C#.
SAPbobsCOM.Documents doc = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
if (doc.GetByKey(4))
{
doc.Printed = SAPbobsCOM.PrintStatusEnum.psYes;
}
int ret_val = doc.Update();
if (ret_val != 0)
{
int err_code = 0;
string err_msg = string.Empty;
oCompany.GetLastError(out err_code, out err_msg);
}
Thanks,
Lan
So far, the only workaround I can think is that I set the BP to active before I change the document Printed status then change the BP back to inactive after I finish changing the Printed status. This solution requires lot of extra DI transactions which could bring risks to our accounting dept.
Any idea?
Thanks,
Lan
Add a comment