How Do I Prevent the End User from Modifying Existing Records? (Magic xpa 4.x)
By default, a Magic xpa task allows users to add, delete, and modify records.
If you want to prevent the user from modifying records, do the following:
-
Go to the task properties (Ctrl+P).
-
Click on the Options tab.
-
In the Modify field, enter No.
Alternatively, you can zoom (F5, double click) from the Modify field to enter a boolean expression. If the expression is false at runtime, the user will not be able to modify the record.
Note: This prevents the user from switching from Query mode to Modify mode and so changing records. However, it applies globally, to all records accessed by the task. If you need more control, say on a record-by-record basis, you need to use a different method, either by setting the allowed mode before the record is opened, or by disallowing changes at a field level.
The Online and Rich Client Samples projects (program TS14 and RTS14)