Repeating section conditional formatting

J

Jeff Donaldson

I have a form I am creating for my organizations performance planning and
review process for each employee in Infopath (with the NEW service pack 2 of
r office 2003 released on 9/28. The form is a three phase process
(performance planning, Mid-year review, and end of year review. presently
these are in word documents as three docs and i am combining them in to one
form. my problem is I have two repeating sections (one for preformance
objectives and the other for development objectives. each of the repeating
sections have a conditional formatting to allow a specific number of
performance (max 10) and development objectives (max 3). the conditional
formatting should prevent inserting after the max number has been reached.

the problem i am having the conditions i set for the performance repeating
section transpose to the development section and the development repeating
sections conditions transpost to the performance section. I have also had
problems with the calculations not comming out right but found a posting
about using the number() function to convert fields contents even though they
are created as decimal content. I keep re-writing the conditions in there
approiate sections and it will work for some time a few minutes and some time
for a few hours. but ALWAYS somehow transposes. this form only has the two
repeating sections. Is this a Infopath bug I am fighting or is there a
workarond (I alread tried to put the conditions in backwards no luck).
 
F

Franck Dauché

Hi Jeff,

You need to use code to do this.
On the first issue, do a search for "Limit Repeating Sections" in this
forum, where I am giving a code sample.
Then, tackle your second issue using code behind as well.

Regards,

Franck Dauché
 
J

Jeff Donaldson

Frank,

I appreciate your quick response to my question and if I have to I will try
your suggestion. My problem with using code in this form is the final
product will be maintained by an AA in the human resources department and I
have been trying to stay away from any code so the form could be maintained
by a Non-developer. Will there be any fixes to this in the near future? The
objective is (was) to train the AA in infopath so they can do future updates
with out support from IT.
 
F

Franck Dauché

Hi Jeff,

My point exactly. That's exactly why I would urge you to use code. You
don't want your end users to deal with settings or code at all. They should
not go in design mode if you want your form to keep working..trust me.

Now, let's say that you limit the number of repeating sections to 10 for
performance.
You deploy your form. The end user now needs to limit it to 11..If you use
code and store that max number somewhere in your schema, your code can read
it and apply it to the appropriate repeating section. Next, you can provide
an "admin" view in InfoPath to allow the end user to simply change 10 to 11.
For the end users, it is simple and safe.

Does it make sense?

Regards,

Franck Dauché
 
J

Jeff Donaldson

Hey Frank,

You ahve been a big help in this. I was not thinking I have alread set up a
max field for both the performance and development objectives. I was trying
to do a repeating section conditional format to disable the insert function
when max (field) = count(....). so using your code will not prevent them
from changing the max nor will they have to do any code changes to to change
the max allowed. so this looks like it will work perfectly for me. I do
however have one more question. one problem i was having when i used the
conditional formatting for the section was the disable feature also disabled
the remove/delete functions also. I wish they would make them two seperate
options. so if any of my users reached the limit when in the mid year they
could not delete and insert a new one. will your code just disable the
insert function. it gets a little complicated for mid-year to end-year. if
they have ten in phase one, "mark" (status field i have in the last two
phases) two as "deleted" in mid-year. they should be able to add two more in
mid year to make up for the ones "marked" as deleted. however the two marked
will still show as to not lose history. so the total objectives could get
higher then 10. but in combination with the status field only 10 can be lets
say "remains as stated". but when i used the disable feather it disabled
both the delete and the insert functions. very rare but in the first phase
in one of my test (when it did work) I reached ten and acted like a director
and changed my mind about one went to delete it and due to the disable insert
and delete option i was not able to delete any of them. this will only be
available in the first phase (performance planning). after that they need to
"mark" them as deleted with the status field as not to lose the history.

sorry for the long explaination. in short will your code just disable the
insert feature or does it disable both insert and delete section?

Thanks again for all your help. I was going crazy (or thought i was) over
this.
 
F

Franck Dauché

Hi Jeff,

Glad I could help.

Yes, code will give you the flexibility that you are looking for. It
doesn't disable any feature of the control (which you can't do by code
anyway), but prevents the addition of an "n+1" element by catching the
OnBeforeChange event an cancelling that event.
Going with code, you could also copy data that the user is about to delete
and push it into a "history" table, etc. You would have the most flexibility
to update the template based on the users feedback.

Good luck with everything.

Regards,

Franck Dauché
 

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