Open Abstracts

Manaz Mohideen
A crossbreed developer playing with MS and Open Source tools.
Posts tagged "infopath"

Apart from working, watching college hoops and NFL games, I have no idea how time flies by so fast. Last week I was assigned to redo this “immoderate” InfoPath form that had no structure along with the lack of commendable functionality. This was my first InfoPath task, so though I’d share some nifty things I learned during the process.

1. ALWAYS create a well organized data source structure.

Because, if you want to change it later on, you are going to end up loosing existing data.

2. Getting the Current User in the local environment (for InfoPath Client)

http://blogs.msdn.com/timpash/archive/2006/08/22/InfoPath-2007-CSharp-Code-For-Retrieval-of-Username.aspx

3. Getting the Current User using Web Services (for InfoPath Web Forms i.e. SharePoint)

http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

4. Getting custom code events to work on a web-based form

Go to Tools -> Form Options -> Security and Trust. Set the Trust Level to Full Trust.

5. Getting cascade drop-downs in a web-based form to populate secondary data source values.

Right-click on the primary drop-down box and select Properties. Go to the Browser forms tab and set Postback settings to Always.

6. Update existing form in SharePoint Library without having to create a new one.

Here, the trick is to create a unique file name for each form. You can use your own naming convention, but make sure to save the filename as a part of the data source. Create a new data connection to the Form Library and use the data field which contains the file name as the filename for the connection and make sure to select the “Allow overwrite if file exists” option. In the form, create an Update button and add a rule with the submit option that makes use of the data connection you just made. You’re done!

I got more, but they will have to wait till my next free tumblr time. :)