Skip to Content
0
Apr 06, 2015 at 02:10 PM

How to change a document status to Printed in DI even if the BP is inactive?

402 Views

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