Programmatically running Field rules

E

Eqix

Hello,

Form Design (simplified):
View 1: Field1 and Field2 (text field that accept numbers)
View 2: Field3 + TOTAL (Field1 + Field2 + Field3)
Field3 has following rule triggered when Field3 is modified: TOTAL = Field1
+ Field2 + Field3.

Scenario (simplified):
Open View1, fill Field1 with "2" and Field2 with "4"
Switch to View 2, fill Field3 with "4"
TOTAL field is recalculated and displays "10" when Field3 is changed.
Switch to View1, edit Field1 to "4"
Switch to View 2, TOTAL still is "10" when it should be "12"

Caveats:
Real form (can't share due to confidentiality) has close to 100 Fields on
View1 (so can't add OnChange rules to every field on View1 to force
recalculation on View2)
Real form View 2 has close to 50 fields, there are about 10 fields in
"Field3" situation and is within a repeating table so couldn't ask user to
"modify" each field on View2 just for the sake of recalculating.

Options
If I could trigger the Rules on View2 fields during the OnViewSwitch event
it'd solve this problem as I could force executing of the Rules every time
the View is "loaded".
 
A

Andrew Watt [MVP - InfoPath]

Hi,

Thanks for the efforts to lay out your situation.

Are you submitting data from TOTAL? If not then just use an expression
box and create the appropriate XPath to display the total. It will,
given the likely complexity of your form be a pretty lengthy XPath but
I think it would be the easiest way to go.

If that doesn't make sense for your scenario it would be useful to
have the following information.

What is the business task that your form template is intended to
perform?

And what is the question? How do you get the form template to give the
desired answer?

How many form controls contribute to the "wrong answer"?

How did you set them up? As text boxes? How did you create the
calculation?

Andrew Watt
MVP - InfoPath
 

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