Friday, June 26, 2009

SP2 fix now available from Microsoft

When Microsoft released SP2 for MOSS 2007, it contained a bug. Applying SP2 would cause the software to expire after 180 days. There were a couple workarounds, but Microsoft has issued an additional update that can be applied before or after applying SP2 that will resolve this problem. More information here from the Microsoft Sharepoint Team Blog.

Convert single-line text columns to multi-line text columns in Sharepoint Lists

Had an issue with my form that is now in production. Users completing the "Additional Comments" field in my form were writing entire novels. Once the form was submitted, the Sharepoint List would only display truncated text, as the column type in my Sharepoint list had been defaulted to single-text. I had to find a way for all the text to appear in the Sharepoint List (so it could be exported to excel and delivered to the client intact), without risking any loss of data on the 200+ forms that had already been completed.

I found a solution via Experts Exchange. The solution is to go into the Sharepoint List > Settings > Document Library Settings, and choose to Create a new Column. I created a column called "Addl Comments Long" and specified that as a Multi-Line text type. I then went to my original form and told it to re-publish. In the publishing wizard window where one chooses which fields to promote, I highlighted my AddlComments field, and hit Modify. From that window, I choose to map my AddlComments field to my new multi-line text AddlCommentsLong column.

I then went back to my Sharepoint List. Bummer, nothing changed. I had to open and close (not save, or edit or change in any way) the completed forms one by one (yes, tedious), but after doing so, it refreshed the data in the Sharepoint list, and suddenly the entire text that users had entered in the Comments field, was now all intact. No data lost, and the client gets what they expect.

Whew!!

Monday, June 22, 2009

Preventing InfoPath forms from timing out in Sharepoint

Had this question posed to me today. Users needed more time to complete infopath forms that were web-enabled on sharepoint. Found this link that explains one can set this timeout value in the Central Admin at: Central Administration > Application Management > Configure Session State

Saturday, June 6, 2009

InfoPath: redirect user to URL on Submit

Was testing my extranet. After a user submitted a Form, the user would be taken to the Sharepoint Document Library showing all completed forms. I didnt want this. OnSubmit I wanted users directed to a URL. There is no such option from within InfoPath.

The solution is to edit the initial link they launch from by editing the &Source portion of that URL. I replaced the &Source portion of the URL on my homepage with the &Source URL I wanted users returned to, and now once the user hits Submit, the user ends up back at the homepage.

Correcting a mistake: Moving a sharepoint site to a new web port.

I created an Extranet site in a fury the other day to meet a client's need. When I went to Central Admin > Application Management > Create or Extend Web Application, I wanted to create my site as: newhostname.mysharepointsite.com. But, the GUI forced me to append a port number to it: newhostname.mysharepointsite.com:47994. In my hurry, I let that go. I needed to get something up quickly and start posting.

Before making it live to the client, however, I wanted the site on port 80. I found that in the original deployment of my single sharepoint server farm, there was a site in IIS that answered all port 80 requests for mysharepointsite.com. In IIS, when I viewed properties on mysharepointsite.com and reviewed the host headers (Website tab > Advanced button), the host-header field was blank. Altho its 'wrong' I removed that blank entry. I then went into my new client extranet site settings in IIS and edited the port number from 47994 to 80, and made sure the host heading was newhostname.mysharepointsite.com. Again, this is wrong, but... there are more steps.

From there, I logged into the Central Admin and went to Operations > Alternate Access Mappings > Edit Public Zones URLs, selected my Web Application, and removed the port number from my extranet's URL. Then I restarted IIS.

And that worked...

InfoPath filters. Where's my 'Where' clause...

I have a copy of an old database in the form of an Excel dump. Ive uploaded the Excel file as a separate list in sharepoint.

GOAL:
Create an online Asset Inventory form in sharepoint that prepopulates field data from my sharepoint list. IE. When user enters an AssetTag that already exists in my sharepoint list, then prepopulate my form's serial#, model#, etc fields, with the values from the sharepoint list. Prepopulating these fields reduces likelihood of user error when completing machine details in my form.

PROBLEM:
I created a Rule on my myAssetTag field in my infopath form.
It says if myAssetTag = DataSourceAssetTag, then fire more rules:
a) set myModelNum to DataSourceModel,
b) set mySerialNum to DataSourceSerialNum, etc.
(Nested rules, all attached to my myAssetTag field.)

When I ran the form it did prepopulate information in the corresponding fields, but it picked the first row of data from the existing sharepoint list, not the data of the specific AssetTag that was entered by the user.

What I really wanted to say was:
myModelNum field should equal DataSourceModel where DataSrouceAssetTag equals myAssetTag.

SOLUTION:
Create a filter in InfoPath. I find this 'feature' somewhat awkward in InfoPath. One has to pay close attention to each window while completing this.

When creating the rule "myModelNum isequalto DataSourceModel", then selecting the Value of 'DataSourceModel', you have to first highlight the field name, THEN select FILTER. This filter button doesnt exist anywhere else, except, and only after a field is highlighted. Once I had the filter box open, I said: 'DataSourceAssetTag is equalto myAssetTag."

This filter is essentially the 'Where' clause I was trying to find. In infopath, the final rule looked like this:

Set a field's value
Field: myModelNum
Value: @DataSourceModel[@DataSourceAssetTag = myAssetTag]

Meaning: myModelNum = DataSourceModel where DataSourceAssetTag = myAssetTag.

Certainly not difficult, but it actually took me awhile to find the right filter, and to make sure I was in the correct window to even be offered the Filter option. Instead I often kept ending up in a New Rule window, which did not meet my needs.

I guess the lesson here was to tread lightly. Its easy to go through next/next/finish and then realize youve completely missed the key step in the process.

Wednesday, June 3, 2009

InfoPath Forms and Sharepoint and annoying Visual Studio

I was asked to put a form on sharepoint. Great. Have a copy of the doc they all wanted posted. I edited it and published it and all was well. Went back to tweak the document and suddenly InfoPath warns me that only an administrator can approve this template. I could not figure out why.

The error I was getting was:
"An administrator must approve this form template before it can be filled out by using a browser. The template may contain form code, require full trust, be enabled to render on a mobile device, or use a data connection managed by a server administrator."

Turns out I made the stupid mistake of accidentally clicking on Programming > Validating Event..., from within a field in my Form. That action opened Visual Studio for me. I closed Visual Studio and didnt think about it.

Opening Visual Studio was apparently my mistake. I finally found this doc: http://support.microsoft.com/kb/922125

Only the "Administrator-approved form template (advanced)" option is available when you publish a browser-compatible form template by using Visual Studio 2005."

Great. >Accidentally< clicking on something should not render one's document incompatible.

The fix is to go into InfoView and click on Tools > Form Options > Programming, and disable the programming.

ARGH!!!!!!!!!!!!!!