No custom code required! You need to look into using current(). For an
example of its use, see
http://enterprise-solutions.swits.net/infopath/shrinking-dropdown-list-repeating
-table.htm
---
S.Y.M. Wong-A-Ton
Thanks, but although that is a great procedure, it is not what I am trying to
do. Perhaps I did not explain properly or perhaps it cannot be done.
This is a form that must be printed out and hand-signed at the bottom of the
page by a person in authority. Normally, that person is a Supervisor, and so
there is a space for a signature with a text box that specifies "Supervisor".
However, if the order includes a Notebook computer, then the signer must be
a VP; a Supervisor signature is not acceptable, and so I would like the
signature line text box to specify the VP approval requirement. It doesn't
matter what else they order, just the fact that they are requesting a
Notebook requires a higher level signature.
The orderer can use rows of a repeating table to request any number of
hardware items, selecting from a list of values I typed to populate a drop
down list. I want to find a way to have Infopath look at all the values
selected in the rows of the repeating table, and if any one of those values
selected is "Notebook", then and only then should the text box by the
signature line change to "VP approval required."
Keep in mind that a person may choose "Notebook" by accident and then
deselect it and choose "Desktop" or "Printer" or some other item instead - -
and then the signature line text box must change back to "Supervisor" when
"Notebook" is removed. So a simple rule that changes the text box to "VP"
as soon as "Notebook" is chosen is not enough because it will not provide for
removal of the Notebook selection and change the text box back to Supervisor.
A rule that runs each time a hardware item is selected will not work because
someone may choose"Notebook" (text box changes to "VP") and then choose
"Printer" in the next row (text box changes to "Supervisor" when I want it to
still read "VP" because the Notebook is still selected in the previous row.)
Our current form in Word just has text on it stating that a VP signature is
required to purchase a notebook computer. Most people claim they never saw
it and turn in the form with a supervisor signature although they are
requesting a Notebook. So I want the signature line to specify either a VP
or a Supervisor, all dependent on whether or not they are requesting a
Notebook computer.
Thanks!
> No custom code required! You need to look into using current(). For an
> example of its use, see
[quoted text clipped - 19 lines]
> > If there is any programming required, please be specific as I am not a
> > programmer. Thanks.
S.Y.M. Wong-A-Ton - 23 Mar 2006 18:46 GMT
I still think you can do this without custom code. What you probably need to
use is a technique I described in this solution
(http://enterprise-solutions.swits.net/infopath/avg-function-infopath.htm)
using a helperField.
Add a text field called "helperField" to the main node of your form
(myFields). Then add 2 rules to the field in the repeating table. The first
rule should set "helperField" to an empty string and the second rule to
anything that's not an empty string, e.g. the text "process". Then you must
add 2 rules to "helperField": One that sets the text box to "Supervisor" and
another one that sets it to "VP". On the rule that sets the text box to "VP"
you must add a condition that says something like:
count(../my:repeatinggroup/my:repeatingtablefield[text()='Notebook']) > 0
You must type this expression in yourself. First you must select the field
of the repeating table on the Condition dialog box, then select "The
expression" from the first drop-down list box, and then modify the expression
to include count(...) > 0
Then add a condition to the rule that sets the text box to "Supervisor", but
instead of count(...) > 0, use count(...) = 0
I've written this from the top of my head, so if it doesn't work, let me know.
---
S.Y.M. Wong-A-Ton
> Thanks, but although that is a great procedure, it is not what I am trying to
> do. Perhaps I did not explain properly or perhaps it cannot be done.
[quoted text clipped - 62 lines]
> > > If there is any programming required, please be specific as I am not a
> > > programmer. Thanks.
JenniferLee - 23 Mar 2006 22:59 GMT
Oh my, oh my! This is so cool. It works perfectly. Really slick. You are
a marvel!
Our department head handed me a beginner book on InfoPath, said "Read this
and we need six forms by next week." Ha ha. That was five weeks ago. I'm
bound and determined to do them right, not just slap text boxes on a page. I
learned a lot by your examples - very valuable assistance. Thanks again.
Jennifer
> I still think you can do this without custom code. What you probably need to
> use is a technique I described in this solution
[quoted text clipped - 89 lines]
> > > > If there is any programming required, please be specific as I am not a
> > > > programmer. Thanks.
S.Y.M. Wong-A-Ton - 24 Mar 2006 15:17 GMT
I like to see people get excited about InfoPath. :) It has its weaknesses,
but it's still a great product. Glad you got your form to work and glad to
have helped.
---
S.Y.M. Wong-A-Ton
> Oh my, oh my! This is so cool. It works perfectly. Really slick. You are
> a marvel!
[quoted text clipped - 99 lines]
> > > > > If there is any programming required, please be specific as I am not a
> > > > > programmer. Thanks.