Hi Experts,
There is a requirement to use ‘Batch’ operation to Delete all child records and insert new child records based on the provided information.
I have used below code snippet to achieve the deletion part.
Requirement: Delete all part needs which have task_id = 253
--batch_d3bcb804-ee77-4921-9a45-761f98d32029
Content-Type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
Content-Type: application/http
Content-Transfer-Encoding: binary
DELETE http://hagilk0/DEMOFSMServer6_4/odata/part_need HTTP/1.1
Content-Type: application/json
Content-ID: 1
{
"task_id":"253"
}
--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621--
--batch_d3bcb804-ee77-4921-9a45-761f98d32029
This is the response that I have received by using the above code.
--batchresponse_1e699066-e693-477a-b4fa-7bac247e6ea8
Content-Type: multipart/mixed; boundary=changesetresponse_2702cf6f-cacf-492a-b213-6656d825b932
--changesetresponse_2702cf6f-cacf-492a-b213-6656d825b932
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 1
HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=utf-8
{"Message":"One or more errors occurred in the batch request."}
--changesetresponse_2702cf6f-cacf-492a-b213-6656d825b932--
--batchresponse_1e699066-e693-477a-b4fa-7bac247e6ea8--
Is there a way to find the errors which are mentioned by the Response(‘One more more errors occurred in the batch request’)
Could you please let me know whether this requirement is possible to achieve through ‘DELETE’ in a batch operation.
Thanks,
Hasara