Monday, May 28, 2012

InfoPath Best Practice - Form Versioning

Because ours is an environment that needed to operate where network connectivity in the field may not be available as our clinicians care for a patient, one of the best practices I found was to actually place a text line in the beginning and end of any form to identify the form.

Every form I publish has something similar to this:

Form Revision Date: 07/07/2011                         Form Revision: 1.5a

I know, it seems so simple!  How do we not realize these things until after a lesson learned? 

If I ever get a call from a clinician who is trying to submit data to our database and they are having problems, I ask them what version they are running. 

This has saved me a few hours of frustration, I am sure.  It's the first question I ask when a clinician calls as the interfaces seldom change at this point, but items behind the scenes may change.

It is possible if you want to go away from Vanilla here and use a record in a DB to check the version before they submit.

My practice is I have a parameter table for the database.

I have a record for each form in the database.  My records would look similar to something like this (Rec#, Form Name, Version) except I use a much friendlier name for the form in my database.

1             Form1                 2.1
2             Form2                 1.1
3             Form3                 1.2

Within the FormCode class of the Form (select Tools/Programming/Microsoft Visual Stduio Tools For Application) create a constant for the form.

const string vFormVersion = "2.0";

As you prepare to publish forms down the road, you need to update this as you go along for each release and have it match the record for your specific form in the database.

Within the InternalStartup() method, you can execute a method you write yourself to query your DB for this value and compare it to the constant within your published form.  If they do not match, you can let the user know via a MessageBox that they need to go get the latest form.

Sending this message when they start up the form is only useful though if they have connectivity. 

If they do not have connectivity in the field, it will allow them to still enter and save the data as an XML document until they try to submit and I stop them again with the error message.

The key that they have the latest form is communication.  It’s not that difficult to put an email out to the group that uses these forms.

And, yes, I know a website or a web page would be the ideal solution regarding not having to tell people to get the latest form, but you have to remember the lack of connectivity is a limitation. 

They need to access the interface offline for submission later as there are large areas in Southern Indiana and Central Kentucky that lack connectivity, thus why InfoPath has worked well for this process.


No comments:

Post a Comment