How can I prevent a user from deleting any rows in Infopath? I just want them to be able to add new rows and make updates.
1 Answers
I dont think you can... Usually the permissions to change and/or add ("edit") means you can also delete (since you could always edit it to be blank/empty anyway).
Here are your permission choices according to the MS Office on-line help:
Users or groups can be given a set of permissions according to the access levels assigned to them by authors using the Permission dialog box, as outlined in the following list:
- Read: Users with Read access can read a form, but they don't have permission to edit, print, or copy the form.
- Change: Users with Change access can read, edit, and save changes to a form, but they don't have permission to print the form.
- Full Control: Users with Full Control access have full authoring permissions and can do anything with the form that the form author can do, such as set expiration dates for content, prevent printing, and give permissions to users. Form authors always have Full Control access.
From infopathdev.com's forums:
If you want to prevent them from deleting data in items within a repeating table there are several techniques:
Disable inserts and deletes the table
TODO: double click repeating table blue button in the designer and under default settings uncheck allow inserts and deletes Pros: easy to do Cons: heavy-handed
Make fields read-only
TODO: double click the cells in each column and check read-only on Display tab Pros: easy to do Cons: can't add data to cells, but rows can still be inserted or deleted
Disable inserts and deletes using a condition
TODO: double click the repeating table blue button in the designer and add a conditional formatting rule to disable insert/delete Pros: easy to do, you can use the expression condition of "1=1" to make it always true Cons: only good for read only items, but you can add a button to insert new items if you use qRules
Make previously entered rows read-only
TODO: add a conditional formatting rule that makes the value read-only based on some condition (for example, already entered data) Pros: supports entering new data Cons: last row is editable until new row is added, semi-complex xpath required to compare current index of row with count of table to allow entering new data, but easy
- 113,841