Delete With Children
You can delete multiple records along with their children. Following are the rules which are used in delete operation.
4. Request Body
4.1 Given both Parent and Children
Only primary key is required to delete a record. All other fields are optional
-
Child business object must be already defined in the metadata relationships as a child of the parent business object.
-
The child records in the given request must be the child records of the given parent records. API will verify their IDs so that you cannot delete child of a different record with a different parent record.
-
API will throw an error incase all the children records are not deleted and you try to delete the parent record.
{
"{{Parent BO Name}}": {
"language": "en",
"timezone": "GMT+08:00",
"data": [
{
"{{Parent BO Name}}_ID": [ID],
"children": {
"{{Child BO Name}}": {
"language": "en",
"timezone": "GMT+08:00",
"data": [
{
"{{Child BO Name}}_ID": [ID1]
},
{
"{{Child BO Name}}_ID": [ID2]
}
]
}
}
}
]
}
}
Try it myself
4.2 Delete Cascade
You can delete whole hierarchy or tree of records but just mentioning the parent record in the request and you set the delete cascade option to true.
Following are the rules which are used in delete cascade operation.
-
Only primary key is required to delete a record. All other fields are optional
-
Child business object must be already defined in the metadata relationships as a child of the parent business object. This cascade delete operation works on the basis of metadata relationships.
-
You do not need to specify any child record in the request just one parent record is enough which is to be deleted along with all of its children and grandchildren.
-
API will first delete grandchildren records, then children and the actual records.
-
API will also delete the search index from search database for these deleted records.
{
"{{Parent BO Name}}": {
"language": "en",
"timezone": "GMT+08:00",
"deleteCascade": true,
"data": [
{
"{{Parent BO Name}}_ID": [ID]
}
]
}
}
Try it myself
5. Responses
When response.status = 200, It will response a `application/octet-stream' excel file.
Otherwise, it will response json file, Please see Responses