Every example of a cascading drop-down in InfoPath is the same. A mostly blank form with just the two (or three) drop-downs taking part in the cascade. And it works...no problems there.
However, that is not real life. My form is an "Edit" form, where the user types in some sort of id and all the fields for the given "row" load into the form. Besides the simple types like Strings, I have two fields that need to be presented as drop-downs where the second drop-down is dependent on the first (hence the cascade). The problem is that the second drop-down is not loading until the user changes the first drop-down but I also need it to trigger when the value is changed when the "row" is loaded.
Here is the sequence:
- The bulk of the form is loaded via a Web Service Secondary data connection. The user types in an Id and clicks a Load button.
- The first drop-down is configured to execute the source query (another Web Service Secondary data connection) on form load so when the main portion of the form is loaded, the drop-down is already populated and the list item is set correctly.
- The first drop-down also has a rule to be executed when the field changes. The rule sets a queryField for a third Web Service Secondary connection to the selected item in the first drop-down and then executes the query for that last web service.
The underlying problem is that InfoPath seem to consider the field being changed when the user manually changes it but not when changed by the initial form