Wednesday, July 15, 2009

Editing Infopath form items in DataSheet view

Now that we have collected mountains of data via my online Form, we need to edit some data fields. (Those who completed the forms cannot spell well, so we want to clean up some plain text fields.) Found that this cannot be done in DataSheet View in Sharepoint. The Data Sheet View is always opened as Read-Only. Found the explanation as to why this is here.
"There are three types of views available. A Standard View shows a list of your forms. A Datasheet View looks like a spreadsheet. With normal lists, you can edit the items directly in the Datasheet View, but data promoted from InfoPath forms cannot be pushed back into the forms by SharePoint, so the fields will be marked read-only. A Calendar View displays a calendar control with the forms displayed at a particular date or range of dates. You can use promoted values (such as the Start Date in the Meeting Agenda) as the date used to display the form." (My emphasis added.)

So... rather than easily edit all incorrect data from a single page, we have to manually open edit and save each Form.

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.