Chadlet
Novice

SmartForm Rule won't fire

I know this is a total newb question, but I'm stumped and can't find anythign obvious that I've done incorrectly. On a view, I have a submit button that I'd like to set to disabled, then when the fields are fully filled the submit button should become available to click. I've created a rule that has conditions for each field "contains a value", and at the end to "enable submit button control". However, when the view is fully populated the Submit button doesn't become available. The only thing I can see that's different from the other rules on the view is that mine shows as "unbound" while the others show "(View)" at the end. What am I doing wrong? How do I fix this?

0 Kudos
Reply
3 Replies
tin
Novice

Re: SmartForm Rule won't fire

Hm... that is an interesting dilemma.  I believe this condition and rule is likely not executing because there is not an event that would kick this off.  Usually a rule will have this structure:


 


When an 'Event' executes (i.e., when view initialize, when button click, when control is changed)


           If a 'Condition' is met (if view passes validation, if control contains value)


                      Then execute an 'Action' (transfer data, execute something, change a control property)


 


But in this case, we just have a condition and an action.  I believe the issue here may that it is an "if" condition, and not a "when" condition, such as:


 


When view pass validation


         Then do something


 


 


 


I would think that an additional component will also need to exists here for a "When" to work (a loop, a listener, a seperate thread?)

0 Kudos
Reply
StevenBrown
Novice

Re: SmartForm Rule won't fire

There does need to be an event for your rule to execute.  What I might do is make an unbound rule (one with no event) that you can re-use, and put the condition "If the view passes validation", then the action "Enable the submit button control".  Then on every required control, I'd add a rule with the event "When the control is changed"  and the action "Execute another rule" pointed to the unbound rule.  I agree that a "When the view passes validation" event would be a nice feature to have.


2016-08-15_10-01-02_2323.png
Reply
BryanPeters
Novice

Re: SmartForm Rule won't fire

If you are going to use an advanced condition make sure there is an event to kick off the rule. Maybe an "On Change" rule. You might even be able to do a few tricks using parameters.

 

Disabling the button seems like the InfoPath way of doing things. I would suggest using a validation rule on the button. "On Click" 

 

4418i8D3554E0B57E58D8.png

 

This will let the user know which required fields are missing. You can also create your own validation rules with custom messages.

 

 

Thanks,

Bryan Peters

 

0 Kudos
Reply