How to prevent changes to previously filled in fields

N

nojyttap

I am creating a form that the user may revise multiple times. I would like to
have a (repeating) field that they make a note of the revisions that they
have done. Then by some trigger (saving or button) I want to lock that field
so that if they make another revision they cannot change the previous
revision notes but have to fill in a new revision notes field (hence the
repeating).

Is this possible? If so, how?
 
G

Gavin McKay

Hello,

I've tried something similar and got stuck, because of the nature of the
repeating rows in Infopath. This might be possible in code, but it would be
low-level and quite messy I think involving recognising how many rows there
were in the table, which ones should be locked, tracking this in memory, and
adjusting as the size of the table changed.

You might be better off "hard-coding" the number of rows as individual items
i.e. number of rows don't change so in affect creating a non-repeating table.
You could then treat each of the items differently like:

[decision 1] - read-only
[decision 2] - write
[decision 3] - read-only

This would limit you to a maximum amount of revisions however which might
not be any good for you.

Another way could be to treat the revision list as its own data source and
submitting via a web service independently. Your web service (or other data
source, i just like web services :) could then advise infopath which parts
were read-only.

Love to know if anyone has a better solution than this, I don't like this
way but it saved huge amounts of code and pain... if there is an easier way
then that would be great!
 
S

S.Y.M. Wong-A-Ton

Which version of InfoPath are you using? And if it's InfoPath 2007, is your
form browser-enabled?
 
N

nojyttap

No, unfortunately I'm using InfoPath 2003.

In the other response to this thread Gavin mentions "hard-coding". The
number of revisions probably won't be but three or four so this is an option.
What is being described by

[decision 1] - read-only
[decision 2] - write
[decision 3] - read-only

?

Is it possible to use a rule to make a field read only?

This form will be used "in-the-field" and the user may not have access to a
network connection.
 
N

nojyttap

OK I found something that will work for me.

First, I inserted an Optional Section. Inside that I placed the text box I
need for the user to fill in.

Next I inserted a check box and another text box. On the check box I set a
rule that when checked it will set the 2nd text box value to "1". I then set
the 2nd text box to read only and changed the boarders, shading and text
color to match the back ground.

Then using conditional formatting when the 2nd text box is equal to 1 it
sets the 1st text box to "read only", the optional section to "Don't allow
users to insert or delete this control" and the check box to "disable this
control".

Once the user has filled in the "revision section" and checked the "revision
complete" check box the section is effectively locked.

Since as I said I will only need 3 or 4 revisions I just duplicated this
optional section 3 more times.

Thanks for your responses it got me thinking.

nojyttap said:
No, unfortunately I'm using InfoPath 2003.

In the other response to this thread Gavin mentions "hard-coding". The
number of revisions probably won't be but three or four so this is an option.
What is being described by

[decision 1] - read-only
[decision 2] - write
[decision 3] - read-only

?

Is it possible to use a rule to make a field read only?

This form will be used "in-the-field" and the user may not have access to a
network connection.

S.Y.M. Wong-A-Ton said:
Which version of InfoPath are you using? And if it's InfoPath 2007, is your
form browser-enabled?
 
C

Clay Fox

One thing I have done before is add a hidden field in the repeating data
where I stored the User's ID who made the comment. Then you can use
conditional formatting to be read only if the user does not match. Also nice
for auditing.

You could also just have a boolean that is true then it is read only.
--
Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum


nojyttap said:
No, unfortunately I'm using InfoPath 2003.

In the other response to this thread Gavin mentions "hard-coding". The
number of revisions probably won't be but three or four so this is an option.
What is being described by

[decision 1] - read-only
[decision 2] - write
[decision 3] - read-only

?

Is it possible to use a rule to make a field read only?

This form will be used "in-the-field" and the user may not have access to a
network connection.

S.Y.M. Wong-A-Ton said:
Which version of InfoPath are you using? And if it's InfoPath 2007, is your
form browser-enabled?
 

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