How do I protect a data field from user edits?
QUESTION: How can I protect a data field from user edits?
ANSWER: A feature within the Census Specification Data Defaults is to Replace all values, whether or not missing. If you choose this option, the data for the field will always be as identified within the Data Default, and the field will be asterisked and grayed out in the Data Review topic of a calculation. Thus, to protect a field from user edits:
In the Census Specifications, create a data default for the field.
Set the Default value or expression to the data field value, itself.
If the field is a scalar, simply type the name of the field.
If the field is an array field, in order to get the whole array rather than just the most recent value, the expression needs to identify the pieces of the array (i.e. Start/Stop date, Effective Date, Value) and then re-assemble the array. For example, to protect the field "Salary", a start/stop array field, the expression would be the following:
B_DT:= #START Salary & ; start date
E_DT := #STOP Salary & ; stop date
Sal:= #VALUE Salary & ; reported salary
11 #ARRAY(B_DT, E_DT, Sal)
Select the radio button to Replace: All values, whether or not missing.
Since this default will always be applied, the user will not be allowed to enter changes when reviewing data prior to completing a calculation.
For example, to protect the date of birth field (i.e. DOB), configure the data default as follows:
When reviewing data, the DOB field is ghosted, no editing is possible, as shown below: