Friday, April 6, 2012

InfoPath Tips #4-Performance Issue Related to Default Value with Formula

A month ago, a InfoPath Form we worked on was on its way to UAT, and the performance was that not satisfying, and one small trick improved the load time of the form from 30 seconds or more to close to 6 seconds, a 80% plus improvement.

We have quite some logic in our form, so one control/field's value would be depend upon the field value of another field, and we used a formula to set the Default Value of the first value with a field from a secondary data connections filtered by the value of the second field. Instead of doing this, I added action to the second field, whenever its values changes, InfoPath would use a similar formula to set the value of the first field.The key is we don't want to waste our CPU cycles re-calculating default values when the form is being loaded and only do the calculation when we need to.

So besides going over the performance guidelines Microsoft published, also pay a bit attention how you use the formula in default values.

No comments:

Post a Comment