Question : Hide/When Help

Working on a new form and looking for some help with the Hide/When code that will be needed.

Have 2 roles, ADMIN and FIELD. The top section of the form when it is opened as a new doc will be data entered by users with the FIELD role. They will then Submit the entry for review by ADMIN. Once they have submitted the entry, those fields would now be Read Only via Computed Text fields for those with the FIELD role and now only editable by users with the ADMIN role.

How can I set the main fields so that when the doc is new that they can enter data into the fields and then then after the submission, they only see the Computed Text field. Basically toggling between the 2 fields.  

Answer : Hide/When Help

Using @UserRoles function, of course, in hide when, like this:

hide-when for fields (admin always sees them; others see them only if the doc wasn't submitted):
    docSubmitted != "" & @IsNotMember( "[ADMIN]"; @UserRoles )

hide-when for computed-text (admin never sees it; others see it only if the doc was submitted):
    docSubmitted = "" | @IsMember( "[ADMIN]"; @UserRoles )

where "docSubmitted" is your flag, a hidden, editable, text field, whose value you set to "1" from the Submit action.
Random Solutions  
programming4us programming4us