Data Connection Error because of too many Site Collection references

by michaellotter 19. December 2008 14:39
This week has been one crazy week for me because Christmas is next week and I’m technically on vacation now for the next 3 weeks.  Just like almost everyone else I've been scrambling to get as much work finished before leaving and I had several projects at once pushing for everything to be released by today (Friday).  This unfortunately caused for some oversight on my part and caused a lot of little interesting problems to pop-up.  One problem that I had was with InfoPath and Data Connections.  During the course of my current project the SharePoint Site Collection where the forms were being deployed and Data Connection files being published changed because of Information Architecture had been modified to include "Forms Centeral" and yesterday I ran into this nice error.
 
“Relative links to Data Connection Libraries located in different SharePoint site collections are not supported”
 
 
 
It didn’t take me long to figure out what the problem was but it was the first time I ran into it and I wanted to mention it.  The error message was dead on and I was getting this because I was referencing 2 site collection data connection libraries.  I had 2 data connections pointing to the old site collection and one to the new one.  After changing the reference everything started working again with no errors.  Since I’m publishing all my InfoPath forms into a single Site Collection I decided to keep all my Data Connection files local to that site collection and not publish them to IPFS data connection library in central admin and when I switched site collections I didn’t update the forms data connection references..  You might be saying that this should have broken right away and in normal circumstances it probably would have but I had the “Allow cross-domain data access for user form templates that use connection settings in a data connection file” option selected on IPFS "Configure InfoPath Forms Services" page and this allows for cross site collection Data Connection and Form Library usage..  It’s turned off now that way I don’t have any more problems like this in the future.
 
If you’re interested in learning more about submitting InfoPath forms across site collections or even web applications you should come out to the spring SharePoint Connections in Orlando because I’ll be doing a session on this very subject.  This is will be my first time speaking at SharePoint connections and I really excited about it.
 
Well it's that time of the year again and I hope that everybody is all ready for the holidays and if not you still have a couple days left.  I’m heading back home from New York to get ready myself and then we are spending Christmas with my folks.  I’m looking forward to it because I’ll be getting a really good home cooked meal and see everybody in the family.  My brother Mark, who just got back from Iraq on Thanksgiving Day, will be there to. It’ll be the first time I’ve seen him since he shipped out in early spring.  This Christmas is shaping up to be a good one for me and I hope everyone else a great one to.
 
Cheers

Tags:

InfoPath 2007 | InfoPath Forms Services

The dreaded InfoPath Forms Services (IPFS) error box

by michaellotter 18. December 2008 11:14

If anybody does any type of InfoPath 2007 browser based form development knows all about the dreaded IPFS error box.  In my opinion it's dreaded because the lack of error details it gives or when it does give details how cryptic it is.  If you don't do this type of development and think I'm kidding checkout the warning box that I got today.

 
Honestly how is anybody supposed to troubleshot this error.  It doesn't say what rules weren't applied or anything that can help you troubleshoot the error or in my case a warning.  When I got this today I went and looked at all the rules to make sure nothing was broken or not set correctly in the form and I couldn't find anything for the life of me and when I ran it through the client no warning or error was received.  At this point some people might be at the point throwing up their arms and saying uncle but just keep reading because not everything is lost.  Since your form is "Powered by: InfoPath Forms Services" there is one other place you can look and it usually gives really good details.  Can you guess where this is at?  Come on think really really hard, think SharePoint, yep you got it, SharePoint log files located in the Logs folder ("c:\program files\common files\microsoft shared\web server extensions\12\logs").  If you open your latest large log file in your favorite editor (mine Excel 2007) and search or filter for "Forms Server" you should find your details.
 
 
 
In my case a Data Connection was giving me problems and until I looked in the SharePoint log file there was no way I was going to find the error.  It's crazy that you have to go this deep to find the actual error message but to be honest I'm glad its being written somewhere and its accesible.
 
Cheers 

Tags:

InfoPath 2007 | InfoPath Forms Services

Creating a .NET Class from a InfoPath form data source using xsd.exe program

by michaellotter 5. December 2008 15:09

When doing InfoPath form development I’m always doingcertain things on a consistent basis and one of them is building a .NET Classfrom my InfoPath form data source.  Theapproach that I’m going to mention can be done in either version but theexample that I’m going to show is for InfoPath 2007.  The reason for building a .NET Class from myInfoPath data source is because I’m usually using the form with a SharePoint2007 workflow (Visual Studio 2008) or .NET Web Service for submitting data to adatabase.  The way I do it is very simpleand keeps the coding process from getting to complex.  Key thing for me is to make things simple andeasy to maintain.  Something to keep inmind is that we’re not building high transaction applications but InfoPath formsfor gathering information from people.   In this article I’m going to show how to takean “Employee Status Report” form data source and convert it into a C#Class.  If you’re a VB.NET person noworries because the process will be exactly the same except for one piece andI’ll point that out.  One more itembefore we get started, when I’m working with InfoPath 2007 forms first then Ialways do is save my form to a project folder but unpackaged.  To do this just use the “save as sourcefiles” command from the “File” menu.

 

The reason for doing this is to have the flexibility to getto any of the files that I want.  Forthis instant I want access to the “myschema.xsd” and “manifest.xsf”.  The “myschema.xsd” file is the XSD file forthe data source that is built with InfoPath designer and the “manifest.xsf”file is the main with all the instructions and makes InfoPath designer launch.

Now let’s take a quick look at the form for this example andthe design of the data source for the form.

  

As you can see the form is very simple but it’s reallyimportant to make sure that the data source is design logically and makes sincebecause we’re going to be using it as an object.  After a quick glance I’m sure you noticedthat “MyFields” was renamed to “EmployeeStatusReport”.  This was done to make sure it has a uniquename and could differentiate itself from other InfoPath form data sources.  Everything else is just named descriptivelyto make sure it’s understandable from the code. I’m not saying that my name approach of the fields is the way to go andany approach would be acceptable as long as its descriptive.

Now that the form is built and saved to my project folderwere going to close InfoPath and open “Visual Studio 2008 Command Prompt”.  The program is located on my machine at“Start -> Microsoft Visual Studio 2008 -> Visual Studio Tools”.  Once the command window is open navigate outto the location of your InfoPath form files. It should look something like the below image.

The file that we are after is the “myschema.xsd” file.  Now that we are in the location of the files let’srun the xsd.exe program to generatethe .NET Class.  Below is the commandline statement that I use but there are many more options available and you canread all them by typing in xsd.exeand hitting enter.

C# version:

xsd.exe /c /l:CSmyschema.xsd

VB.NET version:

Xsd.exe /c /l:VBmyschema.xsd

Once its done running (which should happen in matter of seconds)a message should appear saying that it wrote a new file called “myschema.cs”.

Once the file has been generated I just go rename the fileto the namespace name and then add it to my Visual Studio SharePoint workflowor .NET Web Service project.  Once thefile is available in the project you have the capability to bind the datasource to the .NET Class and you have all your data is available in astandardized format.  If you ever makechanges to your InfoPath data source you’ll need to rerun the xsd.exe commandagainst the new “schema.xsd” file and then just delete the old .NET Class fromthe Visual Studio project and add the new .NET Class to the project and you’redone.

I’ve talked with a lot of hard core developers in the pastabout this approach and a lot of them just look at me strange because I’mhaving a program build the code for me but to be honest it works and I don’tsee anything wrong with it for what I’m using it for.  The cool thing is I never have to make anymodifications to that code file and it’s all generated by the xsd.exe program.  For me this is a great way to get clients tostandardize there development process for building and supporting InfoPathforms.

After this weekend I’ll be putting together a couple morearticles on how I use the .NET Class with a .NET Web Service and Visual Studio2008 SharePoint Workflow project. When reading the next articles you’ll noticethat everything is just as simple as this one is.  Simplicity is my main goal and notcomplexity.

Cheers

Tags:

InfoPath 2007 | Microsoft Visual Studio 2008 | xsd.exe

Easy way to build a .NET Class from your InfoPath form data source

by michaellotter 28. November 2008 11:58

 

When I started my consulting career up again I didn’t have a lot of experience working with XML, XSD or .NET from the application development side but had experience with SharePoint and .NET Console applications.  When I started my new job I was lucky enough to work with a fellow named Josh Carlisle on a project and he taught me how to build my data structures with an XSD file and then convert to a .NET Class with the XSD.exe tool.  It took me awhile to fully understand everything but once I did it made my life so much easier.  Later that year I started working with InfoPath 2003 and at one point during that year I got involved with a large project that required me to add all the data that was collected from a InfoPath form and submit it to a database.  I thought at first this was going to be a royal pain because of the learning curve for XPath and XML (didn’t know it that well) but then I remembered that all InfoPath forms have a XSD file and it could be just a simple of taking that XSD file and converting to a .NET Class with the XSD.exe tool and then binding the InfoPath data source to the .NET Class.  So, I gave it a shot and amazingly enough it worked.  The project ended up being painless because I used this method and it also cut down on the development life cycle.  It’s now the end of 2008 and Office 2003 is just a memory for me and Office 2007 is in full swing but one thing that hasn’t changed is how I read all my data from my InfoPath forms when using them with either a Web Service or Workflow.  That’s right I said workflow, I use the same technique for workflows too because I’m still using InfoPath forms but now with Workflows.  Granted the method is not as simple as with Web Services but it’s still really easy and gives my clients a very structured approach for reading the data from an InfoPath form.  In the coming week I’m going to write two posts on how to do this with a Web Service and Workflow but now it’s back to work for me. Hope everybody had a good day off.

Cheers,
Michael

 

Tags:

InfoPath 2007 | Microsoft Visual Studio 2008

InfoPath team blog is active again with a new series

by michaellotter 3. July 2008 02:06

Last night after attending the SharePoint User Group meeting in NYC Jason Medero, Randi Parrish and I went to SHIMIZU for dinner. This has to be one of my most favorite sushi places in NYC but that’s another post. Once I got back to the hotel after dinner I trolled the net for new information on SharePoint and InfoPath like I do every night and I was quite surprised that Microsoft InfoPath blog was active again and currently has a great series on “Designing browser-enabled forms for performance in InfoPath Forms Services”. It was a nice surprise for me because next week I’m starting a brand new project and its going to be very heavy in InfoPath 2007/InfoPath Form Services and workflow and have some new material to read is nice. Below is a list of all the links to the series at this point.

http://blogs.msdn.com/infopath/archive/2008/05/09/designing-browser-enabled-forms-for-performance-in-infopath-forms-services.aspx

http://blogs.msdn.com/infopath/archive/2008/06/19/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-2.aspx

http://blogs.msdn.com/infopath/archive/2008/06/24/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-3.aspx

http://blogs.msdn.com/infopath/archive/2008/06/25/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-4.aspx

http://blogs.msdn.com/infopath/archive/2008/06/26/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-5.aspx

http://blogs.msdn.com/infopath/archive/2008/06/30/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-6.aspx

Cheers,
Michael

Tags:

InfoPath 2007 | InfoPath Forms Services

Back from SUGDC Regional SharePoint Conference

by michaellotter 29. June 2008 15:50

The SUGDC Regional SharePoint Conference was this weekend (Friday and Saturday) and to my understanding from talking to people that attended both days it was a great SharePoint conference.  I didn’t get to attend both days but just Saturday when I was speaking but I had a great time on Saturday hanging out with Paul Galvin, Becky Isserman and Bob Fox during the afternoon.  This conference was a little different for me because it was the first event I ever spoke at that people actually paid money to attend.  I’m really curious what people thought and I’m hoping that I’ll get some evaluations from the people that attended my session.  I really want feedback from people good or bad so I can approve on things.  When attending some of the sessions with Paul and Becky one thing that I noticed was that I really need to spend a lot more time on getting my slides to look a lot nicer and probably slow down a little when I speaking.  One of the things that I keep catching myself doing is speeding through my sessions trying to get as much content in a session as possible instead of maybe spending little extra explaining things.  One of the things that I really enjoyed besides speaking on InfoPath was having the extra time talking with Paul and Becky and a few other people at the conference.  It is really nice to sit down and speak with people that do the same thing you do and listen to what they are saying and pickup new ideals and making new contacts.  It's too bad that I didn't have the chance to come on Friday so I could see Paul's session because I really think he has done a lot of cool things and I think it would have been a great session.

When preparing my presentation I did a lot of research qualifying everything I would be presenting and I was really impressed with all the detail information on the MSDN site.  I found so much information in the MOSS and WSS SDKs that I was really impressed.  I remember doing SharePoint 2003 it took forever for any good stuff to appear but that’s not the case for MOSS and WSS v3.  Anybody trying to learn SharePoint shouldn’t have any problem doing so anymore.

During the Roundtable session that Becky and I were doing on Ajax and InfoPath Paul asked some really good questions and I will be blogging about them over the coming days because I've had a little time to think about them and do some research.  I truly still can't believe how big InfoPath 2007 and InfoPath Form Services really is.

The conference was a blast and I would like to thank Bob Fox, Gary Blatt and Gary Vaughn for giving me a chance to talk at the conference and I hope they let me come back in the fall.

Cheers,
Michael

Tags:

InfoPath 2007 | InfoPath Forms Services | Public Speaking

How to accidently add an assembly to InfoPath 2007 Form and how to remove it

by michaellotter 27. January 2008 23:07

This is a really old post that never made it because I just totally forgot about it until I read Paul Galvin's post http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!609.entry and I thought it was still worth posting because it's such a common problem and most people don't know that it happens.

So here it goes;

The last few weeks I have learned so many things when working with Josh Medero (Jason Medero brother).  Josh has been helping me out with my InfoPath 2007/InfoPath Forms Services project and he has accidently done a couple of things that I've never done or seen before but that's totally cool because it has helped me learn new things about InfoPath 2007 and InfoPath Forms Services.  As you probably already know this post is about another thing that I learned today.

If you're a developer and have ever worked with InfoPath 2007 forms then you've probably have added a button to the form and have accidentally clicked the "Edit Form Code" button and launched Microsoft Visual Studio Tools for Applications (VSTA) and then closed it because you meant to click the "Rules" button.

When the VSTA window was closed I would have never have thought it would actually create anything and especially if nothing was saved.  For Josh it created an assembly for the form even though no code was added.  He never knew that an assembly was added to the form and I would have never known it but he was having other issues with his form and he sent it to me to open and preview. When I went to preview the form I got the following warning.

The reason that I got the warning was because I don't install VSTA on my laptop but VSTO instead.  After I say the warning message it started to get me wandering what was wrong.  First thing that I did was close InfoPath 2007 and then explored the XSN file and noticed it had a dll in it.  After I noticed this I opened the form backup and went into "Tools" -> "Form Options" and clicked "Programming" category.

The "Programming" category page shows that something was created and once I saw this I just clicked the "Remove Code" button to remove the unwanted assembly.  When I clicked the button the following pop-up came up and I clicked the "Yes" button to remove the code.

After I did these steps I no longer got the warning message when opening the form and Josh problems no longer existed either.  If you really don't plan to do coding in InfoPath with VSTA then I would suggest not to install VSTA that way this problem doesn't occur accidently.

Cheers

 

Tags:

InfoPath 2007

Speaking at the South Florida Code Camp on February 2nd

by michaellotter 20. January 2008 23:57

That's right it's time for the South Florida Code Camp and I'll be down there giving a new session on InfoPath 2007 and Visual Studio 2008.  For this session I'm thinking about changing a couple of things around and doing some really new stuff that includes C# code for updating AD and XMLFormView control for displaying an InfoPath 2007 form.  I'm thinking that the InfoPath 2007 form will be a data entry form that allows users to update their AD information.  I've been thinking about this new presentation for a while and since Visual Studio 2008 was officially released I figured that I should also change up the InfoPath part.  I'm really excited about building the new code and presenting it and after the code camp is over I'll post it on my Code Camp and User Group page.

All the information about the South Florida Code Camp can be found on the http://codecamp08.fladotnet.com/ website.  From what I heard while at Philly Code Camp from other speakers this code camp is suppose to be as big as or bigger than the Philly Code Camp one.  To see what sessions are currently on tap checkout the agenda page http://codecamp08.fladotnet.com/agenda.aspx.  The code camp is going to have 12 different tracks and that means tons of sessions.  The "SharePoint/ Office" track already has my "InfoPath 2007 and Visual Studio 2008" session and "Utilizing Visual Studio 2008 capabilities for better SharePoint Development Part 1 and Part 2" sessions on tap.  In my opinion this track is already shaping up to be a killer track.

I'm really excited about this code camp and I'm glad to have the chance to speak at it and I hope to meet some new SharePoint colleagues there to.  Well I'm about all posted out for the night.  Hope to see some of you there.

Cheers

Tags:

InfoPath 2007 | Public Speaking | Code Camp | Microsoft Visual Studio 2008

Using The expression option and XPath statement for comparing two values in InfoPath 2007 Condition statement

by michaellotter 18. January 2008 09:59

In the post Using InfoPath 2007 Translate function to do what XPath lower-case function does I talked about how to use the “translate” function in a XPath expression box and today I just wanted to continue down the path of using XPath expression box and XPath to compare two values in a Condition statement. In a normal circumstance this would be a very easy thing to do because you would just go select the two fields you want to compare and boom you’re done but what if the two field values are not always the same case. Then what do you do? How do you make everything the same case for both fields? This is a situation that I ran into not long ago and below is how I went about solving the problem.

Whenever building a condition statement you only have the options of choosing an existing Field, Group or “The expression” for the first dropdown list and in normal circumstances this would be fine. In normal circumstances if I wanted to compare two values and they were not fields already in the data source and they would not be visible fields then I would create a new Group called “HiddenFields” and then add the fields to that group and populate them in an opening rule. An example of the condition statement that I’m talking about is below.

 

This works great if all you want to do is a simple comparison and the field values will always be the same text case. As I stated above what if you run across a situation when the text case is going to be different in each field but you still want to compare. You might be thinking that you can use the "Use a Formula" option for each field but unfortunately the "Use a Formula" option is only available for the third dropdown. Below you can see what options are available for each dropdown.

 

 

After looking at the pictures you might have noticed you don't have all the selections available in the first dropdown list that you have in the third one. You're probably thinking that this is going to be very difficult to accomplish but in all actuality it's pretty simple if you use the "The expression" option.

When using the "The expression" option there are a couple of things that you can do to make your life a lot easier when building the XPath statement. If you first build the formula for the third dropdown list before changing the first dropdown list to "The expression" then it will copy everything you did into the XPath statement. I usually set the second and third dropdown list values before switching to "The expression" option in the first dropdown list. If you do it this way then you should get something like the below image when you switch.

 

The formula should look like this.

. = translate(my:HiddenFields/my:Field2, "ABCDEFGHIJKLMNOPQRSTUVWYXZ", "abcdefghijklmnopqrstuvwyxz")

The formula is now 2/3 the way done and now all we have to do is build and add the formula for the first field. The easiest way to do it for this example since the fields are in the same "Group" is to copy the current formula and replace the "." with it and then change the "my:Field2" text to "my:Field1". You might be saying that field box is too small and you wish you had more room to view the formula. If that's the case then open "Notepad" and do all you're editing in there and then paste it back into the field when you're done. At the end the condition box should look like the image below.

 

The formula should look like this.

translate(my:HiddenFields/my:Field1, "ABCDEFGHIJKLMNOPQRSTUVWYXZ", "abcdefghijklmnopqrstuvwyxz") = translate(my:HiddenFields/my:Field2, "ABCDEFGHIJKLMNOPQRSTUVWYXZ", "abcdefghijklmnopqrstuvwyxz")

Having the flexibility to add a formula to your fields when you compare them should open your world to a lot of new options.  Well it's time for me to get back to work and start preparing for my next gig that starts next week.  I'm pretty excited about this one because it sounds like I'll be doing a lot of cool SharePoint development work.

Cheers

Tags:

InfoPath 2007 | InfoPath Xpath Functions

Visual Studio 2008 VSTO and InfoPath-2007 error when trying to run debug

by michaellotter 13. January 2008 22:24

On Saturday when I was adding my finishing touches to my demo for the Philly Code Camp I ran into an error with Visual Studio 2008 VSTO and InfoPath 2007. Whenever I tried to run my InfoPath 2007 form in debug mode I got the following error.

 

"Microsoft Office InfoPath does not recognize some or all of the command line options. Exit and restart Microsoft Office InfoPath with the correct command line options"

When I discovered this error and found out that it happened with a brand new project my heart started to beat a little faster (ok lot faster) because I knew the pressure was on to fix the problem before my session started. I started to do searches on the internet and I couldn't find any answers and then I did one final search and I found some link that talked about a similar error with Visual Studio 2008 Beta 2 and another office application. It mentioned about updating Office 2007 with a patch to fix the error. After reading that I looked at the version I was running and notice that I wasn't running SP1 for Office 2007 and decided to install that and see if it would fix the error. Luckily I had internet access at the code camp and started the download and about 30 minutes later I got it downloaded and installed. Then I crossed all my fingers and toes and tried the debug mode again and it worked. By installing SP1 for Office 2007 fixed the problem. I'm sure there will be many more little things pop-up and if I run into them I'll be sure to post them.

By the way Philly code camp rocked the house and I'm glad that I got a chance to speak.

Cheers

Tags:

InfoPath 2007 | Microsoft Visual Studio 2008

About me

Michael Lotter
B&R Business Solutions
SharePoint Solution Architect
MCTS
More...

 

SharePoint Saturday

SharePoint Saturday is a free event open to the public and is focused on all aspects of SharePoint and related Microsoft Office technologies.  
  

 

 

 

 

 

 

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

RecentComments

Comment RSS