Hi Patrick & Jimmy,
Thank you for your empathy and relating your shared frustrations. When I started using IP I thought "what a great tool" for our purposes. I work in a hospital and I have built managed code forms to help nursing units submit patient information to our Infection Control department and directly into a database. Intense government regulations have "influenced" many of our approaches.
I need to back up for a moment and tell you a story: Several years ago I noticed a severe bug in conjunction with a .Net 2.0 rollout. I am not in I.T. but I produce software like I am. Our I.T. department authorized me to track down the bug on the Premier Support contract they had with Microsoft. It took me over a month to do so and I wound up talking with developers in Texas at the heart of InfoPath development. We actually found a couple bugs, one in System.XML and the other with how IP handled schema references in XML resource files.
Back to topic relevancy: During this process I talked with the developers and explained what I was doing and why. Paraphrasing, the response was that IP was generally envisioned to behave a certain way and IP development was originally and generally intended to be done with rules; however, although what I was doing was pushing the envelope, nothing was inherently wrong with my approach and in fact IP supported that in that IP supports managed code processing.
So what am I doing that requires code?
First, HIPPA and other government regulations require that health information be tied to a source, in other words, we can't receive anonymous patient information without knowing who sent it. Furthermore, we use Single Sign On in our facility. So, in order to ascertain who is sending the information we need code to interface with the system to determine who is logged on.
Second, our validation rules are too complex for the standard rule based approach.
Third, in filling out the form, utilization of Windows forms dialog boxes were necessary. Using other views was not sufficient and switching back and forth was not satisfactory.
Forth, we needed custom event handling that just worked better in code and in some cases was really only viable in code.
So, I think I need to stay with code. I will check out qRules. I find it interesting that IP 2010 seems only to use VB and C# and no longer appears to support JavaScript or VB script. It used to be with IP 2003 that if you wanted a managed code form you had to go out of your way to do it with Visual Studio 2003. Now, with VSTA part of IP 2010 it is all too easy to create managed code forms from within the IP application itself.
Jimmy,
Could you please clarify, are you advocating a directory structure with everything in one folder as in
My Project Folder
manifest.xsf
schema.xsd
view1.xsl
FormCode.cs
Assembly.cs
or something along the lines of
My Project Folder
XSN Files Folder
manifest.xsl
schema.xsd
view1.xsl
Code Files Folder
FormCode.cs
Assembly.cs
Also, I recall the proviso about Read Only in the video. It didn't make any sense to me. Do you know why it does that and what is going on with this? You mentioned that if the files are Read Only that updated/new files get copied to another location. I didn't think this was what was happening to me as my files are not yet under source control but maybe this is the beast which is afflicting us all? I haven't investigated this yet, bet maybe if this is what's happening I'll have to write an add-in or something to remove the Read Only attributes. Similarly, maybe an add-in to check vanishing assembly references and automatically put them back. Maybe you can try testing IP 2010 with the Microsoft.Office.Interop.InfoPath.SemiTrust assembly. I'd be curious to see if this assembly vanishes for you as well in IP 2010 with CSharp.
Thank you Patrick and Jimmy for your comments. It looks like I will just have to bite my tongue and grin and bear it for the time being. It may be that we will have to abandon InfoPath if it is going to remain so quirky and (at least not in spirit) support managed code development.
Cheers,
Tony