Skip to Content
Mar 16 at 01:32 PM

Property 'ReturnReason' of 'DocumentLine' is invalid

57 Views Last edit Mar 17 at 05:39 AM 4 rev

When trying to set the ReturnReason in the Draft Line in the DI it throws an Exception: "Property 'ReturnReason' of 'DocumentLine' is invalid". This happens in Version 9.3 and 10. Is there any way to set the ReturnReason in a Draft?

SAPbobsCOM.Documents oRetoureDraft = (SAPbobsCOM.Documents)SAPInfo.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts);

oRetoureDraft.DocObjectCode = SAPbobsCOM.BoObjectTypes.oReturns;

oRetoureDraft.Lines.ReturnReason = 1;