Delete a BDM entry in datatable?

Hi everybody 

I created a simple workflow handled in an application page that contains a table, a button to start a new process (that creates a new entry in the datatable) and now I would like to complete my CRUD operations on the table with a delete. I've already read that it's suggested to not delete the entry, but to set a "deleted" boolean flag, so I did in that way. Now for each entry, I put a button (the red one bottom in the screenshot) that should delete the entry (i.e set the "deleted" flag on the bdm entry to true). I tried to use a custom query and calling it with the button, but I discovered that UPDATE queries are not allowed. So, how can I accomplish this simple task? 

test application with datatable

Hello,

BDM data manipulation is always performed via a process to ensure traceability and security. So from your UI you need to interact with a process to do the deletion. 

Because you want to build a CRUD system, I suspect you will end up with several processes:

Create <myData>: the very first process that creates your data (what ever your data is, e.g. invoices, orders, accounts,). This process takes all the mandatory inputs to create the data consistently.

Update <myData>: the process you can start when the user want to edit one particular data. This process may takes the id of the data to update and present in a human tasks a form to let the user enter the necessary inputs to perform the update. The submission of the human task would perform the actual update in the BDM.

Delete <myData>: the process to start when the user wants to delete a particular data. This process should take the id of the data to delete and a human task should ask for the user confirmation then delete the data from the bdm. To do so, in your Bonita Studio, go into Operations and select your business object (you would have initiated from the ID received as part of the Process Contract) and the operation called "is deleted". 

Hope this helps

Captain Bonita

Very clear, Thank you for your help.