Client Survey
| Id | Name (Link) | Surname | Gender | Marital Status | Have Kids | Mobile | Age | Last Updated On | Remove |
|---|
1
2
3
...
Requirement: Form and DB Operation 8 - Show Deleted Records (Soft Delete Management)
This exercise focuses on managing soft-deleted records by implementing a mechanism to view and restore them, demonstrating advanced conditional logic in the UI and filtering data based on the IsActive attribute.
List Screen Updates & Filtering:
- Add a Toggle Switch named "Show Deleted Record" next to the search field. It should be off by default.
- The table filter must be controlled by this switch:
- OFF (Default): Show only records where IsActive = True.
- ON: Show only records where IsActive = False (Deleted Records List).
Conditional Actions (Based on Record State):
- When the toggle is ON (showing deleted records):
- The column header for the last column must change from "Remove" to "Restore".
- For any deleted record, the Name link must be visually and functionally disabled.
- For any deleted record, the action icon must change from the Trash icon (🗑️) to a Checkmark/Restore icon (✅).
- When the **Restore icon** is clicked, a confirmation popup asks to proceed: "This record will be restored and moved to the active records list. Would you like to proceed?". Upon confirmation, the record's IsActive is set back to True, and the list is refreshed.
- When the **Trash icon** is clicked for an active record, the confirmation popup says: **"This record will be soft deleted (IsActive = False). Would you like to proceed?"**.
Hint (OutSystems): Conditional column headers and icons are achieved using variables or expressions based on the toggle state. Disabling the link is done by setting its **Enabled** property to False or by conditionally rendering a different widget (like static text).
Practice with Ankit | Form and DB Operations