Client Survey
| Id | Name (Link) | Surname | Gender | Marital Status | Have Kids | Mobile | Age | Last Updated On |
|---|
1
2
3
...
Requirement: Form and DB Operation 6 - Add new fields (Gender, DOB, Age Calculation)
This final exercise focuses on integrating new data fields with specific data types (Date, Static Text List) and introducing a client-side calculated field for display.
Database Entity Setup:
- Add two new attributes: Gender (Text) and DOB (Date).
Form Implementation:
- The Gender field must be a Dropdown with options: Male, Female, and Undefined. The Undefined value must be the database default/selected value.
- The DOB field must be a Date Type input and is a Mandatory field.
- Ensure both fields are included and function correctly in both the Add and Edit forms.
List Screen Update & Calculation:
- Add a new column, Gender, to the main list screen.
- Add a new column, Age, which displays a calculated value.
- The age must be calculated based on the client's DOB relative to the current date and displayed in the format: <n> Year, <n> Month.
- *Example 1:* If the age is 1 year and 1 month, show: 1 Year, 1 Month.
- *Example 2:* If the age is exactly 5 years, show: 5 Year. (Do not show '0 Month')
- *Example 3:* If the age is 11 months, show: 11 Month. (Do not show '0 Year')
Hint (OutSystems): Age calculation logic is typically done in an Action or a Client Action and is often implemented as a custom Function for reusability across screens and expressions.
Practice with Ankit | Form and DB Operations