Read-Only Form Best Practice

Good day. Is there a best practice for implementing the following:

. Form loads to show detailed data from a selected row in a table

. If user does not have required permission to edit, form should be entirely read only (no changes allowed to any component)

. If user has required permission to edit, form should not be read-only and submit button should do an UPSERT

Thanks.

@haj
The second part:
If user has required permission to edit, form should not be read-only
That is a contradictory statement.... if the user edits the fields the form is not read only, it will be submitted with changes.

The way I do this is set a Variable to true or false depending on the user's permission level. Another option would be to use a Transformer that returns true/false.

Then I set each individual component's Read Only property to that variable. Also set the Disabled property on the submit button.

Read Only is in the Advanced option under Interaction.

There is no Disabled property for a form submit button so I change it to Default:

image

If this breaks other form functionality for you (validation for instance), then you can keep it Submit and use Hidden.

1 Like