cancel
Showing results for 
Search instead for 
Did you mean: 

RequiredDate is missing

0 Kudos

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();

View Entire Topic
0 Kudos

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...

edy_simon
Active Contributor
0 Kudos

Hi,
In header: RequriedDate
In lines : RequiredDate

Notice the spelling

Regards

Edy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ramstein74,

Property name for Purchase Request Header is: RequriedDate

Property name for Purchase Request Lines is: RequiredDate

Kindly correct the HTTP request which you are sending to Service Layer to process.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

0 Kudos

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 .. 😉

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

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