An application has a custom table 'u_project' with a field 'u_status' (choice list: Not Started, In Progress, Completed). The developer wants to prevent any update to the record if the status is 'Completed'. Which approach should be used?
Trap 1: Create a Database View that filters out Completed records.
A Database View does not prevent updates to the base table; it only filters records in the view. Updates can still be made via other means.
Trap 2: Create a Client Script that sets the field to read-only when status…
Client Script only affects the UI; it can be bypassed by direct API calls or database operations.
Trap 3: Create a UI Policy to disable the entire form when status is…
UI Policy is client-side only and can be circumvented; it does not provide server-side enforcement.
- A
Create a Database View that filters out Completed records.
Why wrong: A Database View does not prevent updates to the base table; it only filters records in the view. Updates can still be made via other means.
- B
Create a Client Script that sets the field to read-only when status is Completed.
Why wrong: Client Script only affects the UI; it can be bypassed by direct API calls or database operations.
- C
Create a Business Rule with condition 'current.u_status.changesTo("Completed")' and set 'current.setAbortAction(true)' in the script.
A Business Rule with the condition `current.u_status == 'Completed'` and `setAbortAction(true)` correctly prevents any update when the status is Completed. Even though the option text specifies `changesTo`, the core concept of using a server-side Business Rule is correct.
- D
Create a UI Policy to disable the entire form when status is Completed.
Why wrong: UI Policy is client-side only and can be circumvented; it does not provide server-side enforcement.