Delete
To delete a record we will make a GET call on the delete endpoint, specifying the record we want to delete
Request
POST /crm/leads/delete.json?id=1811&is_confirm=1&override=1
Params
idthe id of the requested recordis_confirm=1to confirm deletion of the recordoverride=1to override the confirmation screen (available only on when using FIYGE as a full stack framework)
If the response has an empty error response, the record was deleted successfully
Permission
To delete a record on FIYGE, you must have proper delete access to the record. This can be found in the index call or the view call.
Index
On the index call there is a flag is_delete that will tell the logged in user if they have access to delete
{
"paginate": {
"data": [
{
"peoples.name": "Test PEOPLE",
"config_people_types.people_type": "Client",
"Company": null,
"Sub Type": "B2B CLIENT",
"Agent": null,
"Current Stage": "01 Create People",
"Current Workflow Actors": "Michael Ilao",
"People ID": "50",
"peoples.created": "2024-12-12 09:46:29",
"peoples.modified": "2024-12-20 11:05:00",
"peoples._acl_comment": null,
"peoples._acl_edit": " u739",
"peoples._acl_tmp_edit": "",
"peoples._acl_delete": null,
"peoples._acl_tmp_delete": "",
"peoples_companies._acl": null,
"peoples_companies._acl_tmp": null,
"peoples.deleted": "0",
"peoples.id": "50",
"record_display_name": "Test PEOPLE",
"is_edit": true,
"is_delete": false,
"is_comment": false
},
]
}
}
View
On a view call there is a flag on the top level of the response called is_deletable.
{
"data": {
"leads": {}
},
"errors": [],
"message": [],
"primary_key": "id",
"display_field": "name",
"model": "leads",
"model_class": "\\module\\crm\\model\\leads",
"id": "1811",
"is_record_deleted": false,
"permissions": {},
"model_associations": {},
"model_behaviours": {},
"name": "Test Lead 1",
"filterRules": {},
"form": {},
"rebaseline": [],
"allow_comments":1,
"is_editable": 1,
"is_deletable": 0,
"alias": "leads",
"singular": "lead",
"controllerClass": "\\module\\crm\\controller\\leads",
"modelClass": "\\module\\crm\\model\\leads",
"notEmptyField": {},
"user_id": "739",
"user_fullname": "Michael Ilao"
}