Delete a Row

Catalyst Flutter SDK enables you to delete a single row from a specific Data Store table. However, you will not be able to delete multiple rows at a time. You can delete a row from a table by fetching the row instance and passing it to the delete() method.

The <ROW_INSTANCE> used in the code syntax below is the instance defined in the Row Instance page.

    
copy
<ROW_INSTANCE>.delete( void Function() onSuccess, void Function(ZCatalystException) onFailed )

A sample code snippet with fetching the row instance is shown below:

    
copy
ZCatalystApp.getInstance() .getDataStoreInstance() .getTableInstance(identifier: 'Products') .getRow( id: 2823000000014176, //Fetch the row instance onSuccess: (APIResponse response, ZCatalystRow row) { row.delete(onSuccess: (APIResponse response) { //Delete the row print('Row deleted successfully.'); //Actions to be executed upon a succesful deletion }, onFailed: (ZCatalystException exception) { print('Exception thrown: $exception'); //Actions to be executed upon failure }); }, onFailed: (ZCatalystException exception) { print('Get Row Failed: $exception'); //Actions to be executed upon failure in fetching the row instance }, );

Last Updated 2023-12-15 18:54:08 +0530 +0530

ON THIS PAGE