Hi,
I'm trying to capture a purchase invoice. But everytime I try, I get a "Date deviates from permissible range" error.
I've looked at the following, solution, but I doesn't seem to solve my problem : http://wiki.sdn.sap.com/wiki/display/B1/ErrorMessage-Datedeviatesfrompermissiblerange%28DocumentName-offendingdate%29%28Message173-11%29
This is the code I have :
oInvoice = CType(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices), SAPbobsCOM.Documents)
With oInvoice
.CardCode = "abc"
.DocDate = CDate(Format(Date.Parse(CStr(Now)), "dd/MM/yyyy"))
.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
.Lines.ItemCode = "A1002"
.Lines.Quantity = 1
.Lines.Price = CDbl(500)
End With
Under general settings in SAP, my date format is DD/MM/YYYY
Please help coz I don't know what I'm doing wrong.
Thanks