Programmicatly check if form is in read-only mode

F

Franck Dauché

Hi,

You don't have access to controls by code in InfoPath is it is what you are
after. If some of your controls need to be read-only and you need to know
about it, you can do the following:
create a new node (field1) in you schema to hold a boolean and use
condtional formatting to set the read-only property of your controls based on
the value of field1 (true or false).
Then, by code you can check the value or change it for that matter...

Hope that it helps.

Franck Dauché
 
D

digitor

the problem i have is that if 2 people open the same form and one has
it in read-only mode they are still able to click a button which does
an action on the database - which i want to prevent
 
F

Franck Dauché

Then, if your form is read-only, you could update a node in your schema to
reflect that status. you could then use conditional formatting to disable
your buttons based on the value of that node. The only button available to
these users (having the form in read-only mode) would be a close button.

Franck Dauché
 
K

kometes

There is a "IsReadOnly" property on the XDocument object that will be
true if the document was opened in "Read-Only" mode.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top