Club/Team Form: Delete
Configure the club/team form to delete a record.
This is the process we will follow.
DELETE
Add a 'delete' data source for deleting a single club record
Link the key club record identifier to this ReST API end-point if necessary
Map the custom variables mapped to the form fields to the data source body fields
Assign this 'delete' data source to the data entry form
Configure the delete button
Test that we can delete a club/team using the Delete button
Add a DELETE Data Source
Open App Studio, open the Data Sources configurator, select the Teams folder you created previously, then select the "Read a Club/Team" node and use the clone button to clone this request:

The Clone Request modal popup form shows asking you to name the request:

Type a meaningful name such as "Delete a Team" and click Save.
The request will be added to your tree view beneath the Teams folder. Take this opportunity to drag and drop the order of the requests to fit the CRUD acronym:

Edit Properties
Edit the properties in the Details tab by referencing this list of ReST API end-points.
URL
https://football-891b.restdb.io/views/DeleteFootballClub
It is known from the documentation that this ReST API end-point has a team identifier property ?ID=.
We therefore type this parameter list into the URL so that it reads:
https://football-891b.restdb.io/views/DeleteFootballClub?ID=
Whilst the caret is still blinking after the last character typed, click on the Insert Variable button to choose the TeamID
custom variable which when applied should show the custom variable appended to the end:

HTTP Verb
The default GET verb/method is not correct for deleting a single record using the ReST API and should be set to DELETE for this specific back-end end-point.
The request should now look like this:

Authorisation
Previously we set up security credentials at the Football folder level, so we can leave this to be set to "Inherit from parent".
We do not need to change anything else.
Send Request
It is best practice to now click this button on the Details tab to send the request to the ReST API.
The problem however is that we would have to delete an existing record in order to test this.
The best way of course to test this is to use the actual Club form we created here, and link that form to this data source request, then we can test it.
Edit Form
Open App Studio, open the Forms configurator, then select the Club form:

Click the Edit button to open the form properties modal popup.
Data Sources
Click the Data Sources tab. There are 4 CRUD data sources lines. Click this database icon to assign the Delete data source:

This modal popup form appears to allow you to select the previously created data source request. Navigate through the folder hierarchy until you locate this data source request, then click the Select button.
This Delete data source request should now appear in the list of assigned data source requests:

Now click the Apply button on this form, in order to persist the form properties. The Delete data source request you added should be shown in the properties list:

We do not need to design the form.
We will now configure the delete button on the form.
Configure Delete Button
Open App Studio, open the Forms configurator, then select the Club form and click the edit button. Then click the CRUD tab:

There are four mechanisms to control form Create, Read, Update and Delete. We are only interested in Delete at this stage.
Delete
The delete button lives together with the update button top right on the form:

It can be hidden, its caption set and its icon set.
Apply
Apply any changes to persist them before testing.
Test
You can now test your configuration by opening the Football Industry group in the navigation bar and selecting the Clubs/Teams item. Drill down into the last test club you created to open the form.
Press the Delete button. You will be prompted to confirm the deletion.
The form record deletion should be confirmed when the form is closed:

Last updated