Hello,
I'm running into some more problems while designing my forms. I am using InfoPath 2010 and SharePoint 2010 Server
I have a form that gathers information and it has a header section that pre-populates fields with information such as the current user, data, form number etc
I have two problems with this form:
1) I try to populate the Office field by querying an SQL database with employee information. I am pulling the current user's real name via a web service and I would do the same for the Office field but we don't store the office information in AD, we store it and other information in an SQL database. So fine, I created a data connection to that database, and it pulls that information from the table. It works perfectly fine in Preview mode, however when I publish and upload to my site and I try to Add Document, it throws a pretty common error (error while querying data source). I've looked it up and it appears to be a pretty common problem but everything people have said and everything in the Event log didn't work to fix the problem.
I have tried:
-Changing the form to Full Trust
-"Allow cross-domain data access for user form templates that use connection settings in a data connection file" is checked
-I have tried converting the data connection to a file and have it both in a Data Connection Library and under Manage Connection Files
-I've tried deleting all the connections and re-doing them by re-converting and re-uploading etc.
I'm at my wits' end with this problem.. I need to get it working but I just can't seem to do it. If anybody can help in any way I greatly appreciate it.
2) Another of the fields in the header is a form number. The form number has the following format: "QI-YYYY-###", where YYYY is the year (easy enough to retrieve and filter using substring() and today()..) but I can't figure out the sequential numbering. I've read a bunch of threads and blogs about it but I can't get it to work for me. I don't want to use buttons on my form or anything I just need the form to look up the highest number from the library, and make that form number the next one (taking into account and addressing the fact that two people might open a new form at the same time and get the same form number) and adding leading zeros so that if there are two forms in the library with QI-2012-001 and QI-2012-002 then when the next form is submitted it looks up the highest number and makes the form QI-2012-003 and so on... and then at the new year, the numbering restarts at QI-2013-001. I know I need to use data connections to lookup the highest form number using the max() function and so on but I need to do this without using buttons on the form or anything.. so when the user clicks Submit on the ribbon, it does this look up. I realize these are somewhat complex requirements but if anyone knows ANYTHING that can help me, please let me know!
Thanks in advance guys & gals :)