on 02-18-2016 1:09 PM
hello,
When i am trying to create a Purchase request i always get the following error "Required date is missing (1)"
Code:
---------------
SAPbobsCOM.Documents pRequest = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseRequest) as SAPbobsCOM.Documents;
pRequest.Requester = "38";
pRequest.ReqType = 171;
pRequest.RequriedDate = DateTime.Now;
pRequest.DocDueDate = new DateTime(2016, 2, 19);
pRequest.ClosingDate = new DateTime(2016, 2, 19);
pRequest.DocDate = new DateTime(2016, 2, 19);
pRequest.EndDeliveryDate = new DateTime(2016, 2, 19);
pRequest.DocType = BoDocumentTypes.dDocument_Service;
pRequest.Lines.BaseLine = 0;
pRequest.Lines.ItemDescription = "Testing Service";
pRequest.RequesterEmail = "test@test.com";
var ret = pRequest.Add();
Sorry but the error still returns with RequriedDate on rows
this time it returns the error in Portuguese, dont know why but its the same
Data necessária em falta (1)=Required Date is missing(1)
Any more help please?
Service Layer should be 100% perfect. This is a simple example and it fails .... and i´m completely lost...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
Ankit i tried your suggestion but after i get a different error
No matching records found (ODBC -2028)
Sorry to insist but i guess i´m almost there ....
As i want to create a service request( it can be anything) i dont know or have an ItemCode for that. I think the error comes from the ItemCode=0
Please help , again .. 😉
Hi ramstein74,
If you are creating Service Type Purchase Request, the HTTP request should be as below:
{
"DocType": "dDocument_Service",
"DocDate": "2020-11-07",
"DocDueDate": "2020-12-07",
"TaxDate": "2020-11-07",
"RequriedDate": "2020-11-07",
"DocumentLines": [
{
"ItemCode": null,
"ItemDescription": "TEST Via SL",
"RequiredDate": "2020-11-07"
}
]
}
If you are creating Item Type Purchase Request, the HTTP request should be as below:
{
"DocType": "dDocument_Item",
"DocDate": "2020-11-07",
"DocDueDate": "2020-12-07",
"TaxDate": "2020-11-07",
"RequriedDate": "2020-11-07",
"DocumentLines": [
{
"ItemCode": "A00001",
"Quantity": 2,
"RequiredDate": "2020-11-07"
}
]
}
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
User | Count |
---|---|
97 | |
10 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.