InfoPath Get Name Field from Data Connection and more

Using a combo of a View and Data Connection we will be able to grab ALL of the fields from a List or Library.

1. Open a Text file so you can paste stuff into it.

2. Open the site you want to gather the data from.

3. Navigate to Site Action > Site Settings

4. Under General Settings click on Audience targeting settings. With this page open look at the URL. Starting with the word List, copy everything to the right.

Example: List={515dc5f2-88b9-4f91-80a3-4e133f25d069}

5. Using your Text file, first paste your new List GUID onto the file, next page this string on a another line _vti_bin/owssvr.dll?Cmd=Display&List={GUID}&XMLDATA=TRUE&noredirect=true

6. Now, going back to your List GUID copy everything between the {} brackets. Then paste it into the {GUID} string got from my site, replacing GUID.

Example: _vti_bin/owssvr.dll?Cmd=Display&List={515dc5f2-88b9-4f91-80a3-4e133f25d069}&XMLDATA=TRUE&noredirect=true

7. Go back to your site and paste the long string you just create into the sites URL (see example below for more detail).

Example: http://SiteName/SubSiteName/_vti_bin/owssvr.dll?Cmd=Display&List={515dc5f2-88b9-4f91-80a3-4e133f25d069}&XMLDATA=TRUE&noredirect=true

8. You should now see a page full of XML pertaining to your List or Library.

To take this to the next level you can create a View to narrow down the columns returned in the XML.

1. Create a new View with the fields you want.

2. Edit your newly created view. With the Edit View page open scroll down to Mobile section. Looking at the URL under “Web address for this mobile view:”, grab all the letters and numbers after View=

3. Open this site (http://meyerweb.com/eric/tools/dencoder/) and paste that string into the URL Decoder/Encoder box and click the Decode button.

4. You should now have a cleaner GUID.

5. Paste that new GUID into your Text file.

6. We will now want to join the new GUID with our existing URL string (see below for example).

Example: http://SiteName/SubSiteName/_vti_bin/owssvr.dll?Cmd=Display&List={515dc5f2-88b9-4f91-80a3-4e133f25d069}&XMLDATA=TRUE&noredirect=true&View={8478D19F-831D-45CB-8F24-A481444C5418}

7. You should now see different results than the first URL string we created.

Now the good stuff! Using the URL you can create XML Data Connections in InfoPath and be able to view columns that were once unavailable.

InfoPath get current username

If you are looking for a way to capture the login user name in InfoPath try this.

Dim sUserName As String = System.Enviroment.UserName

If you want to capture user name from SharePoint try this:

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

Things to remember when migrating to a new farm

I will continue to update this list…

1. Check your new Farm for blocked file types.

Central Administration > Operations > Blocked File Types

2. InfoPath forms.  Make sure you check that your forms are working in the new Farm.  In my case, the forms had the old URL and wouldn’t work.  I had to also update / relink the forms to their corresponding library.

3. PDF icon

http://support.microsoft.com/kb/837849

4. When we created the new Farm we also used all new AD accounts.  When I tried to crawl our network I was only able to crawl public folders. Fix? Replace the old crawl account on the domain with the new account or update your new Farm with the old crawl account.

Shared Services Administration: SSP1 > Search Administration > Default content access account

5. BDC.  This has turned out to be a big one.  I wasn’t able to simply export the BDC definition files from the old Farm and import them into the new Farm.  I had to recreate all the BDC files, security, and update all the pages that were using the BDC data.  If you are not using BDC Metaman, you need to start!

6. If you are moving to Windows Server 2008 make sure you read this KB article.

Access is denied. Verify that either the Default Content Access Account has access to this repository, or add a crawl rule to crawl this repository. If the repository being crawled is a SharePoint repository, verify the account you are using has “Full Read” permissions on the SharePoint Web Application being crawled.(The item was deleted because it was either not found or the crawler was denied access to it.)”

http://support.microsoft.com/kb/896861

7. Search Scopes, none, zero, nothing was moved over when we migrated.  i’m now in the process of trying to recreate all the search scopes.

8. reapply the Adobe PDF filter to the Farm.  This post goes into great detail on how to apply the update.

http://bloggingabout.net/blogs/harold/archive/2008/10/02/index-pdf-documents-on-sharepoint-using-adobe-pdf-ifilter-9.aspx

How to Relink Multiple InfoPath Forms in SharePoint

After our farm migration, we realized that our new domain name and InfoPath didn’t get along.  Our old domain name was a simple http://intranet and all the InfoPath Forms were linked to that name.  After being asked to re-link several thousand forms (clicking one at a time) I started looking around the web for a solution.
Here is what I found:
1)    Open the library. Click Settings –> Form Library Settings –> Relink documents to this Library. Now copy the URL in your address bar.
2)    Open this page in SharePoint Designer. File –> Open –> paste the URL in the File name: field and click Open.
3)    If you don’t see the split screen layout, complete the following steps. Click on View –> Page –> Split
4)    Locate the <FORM> tag within the HTML section of the page and place the following code before the </FORM> tag.
<script type=”text/javascript” language=”javascript”>
function CheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}
</script>
<input type=”button” value=”Check All” onclick=”CheckAll(document.forms.aspnetForm.chkRepair)” >
5) Save, Refresh the page, you should now see a Check All button in the bottom left corner of the page.

Here is what my HTML looks like:

<FORM id=”SubmitRepairDocsForm” method=”POST” action=””>
<INPUT id=”SubmitRepairRedirectList” type=”hidden” name=”SubmitRepairRedirectList” />
<INPUT id=”SubmitRepairRedirectFolder” type=”hidden” name=”SubmitRepairRedirectFolder” />
<INPUT id=”SubmitRepairDocs” type=”hidden” name=”SubmitRepairDocs” />
<SharePoint:FormDigest runat=server ForceRender=”true”/>
<script type=”text/javascript” language=”javascript”>
function CheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}
</script>
<input type=”button” value=”Check All” onclick=”CheckAll(document.aspnetForm.chkRepair)” >

</FORM>

Edit…

If you want to speed up this process, you can also edit the RowLimit property.
Search in the code for RowLimit, by default it’s set to 100, change it to 500.

RowLimit Paged=”TRUE”&gt;500&lt;

Duplicate results when searching for a person in SharePoint 2007

 I was seeing duplicate people returned when searching for someone.  Here are a few things I did to locate and fix the problem.

First, check the People scope in the SSP.

Shared Services Administration: SharedServices1 > Search Administration > Scopes

http://moss1:8888/ssp/admin/_layouts/viewscopesssp.aspx?mode=ssp

This scope should have a rule of:

contentclass = urn:content-class:SPSPeople

     Behavior: Require

Take not of the Item Count.

Now take a look at the User Profiles and Properties page.

Shared Services Administration: SharedServices1 > User Profile and Properties

http://moss1:8888/ssp/admin/_layouts/ProfMain.aspx

In the Profile and Import Settings section look at the first item Number of user profiles:.  If this number doesn’t match the Item Count from the Scope you are    pulling too many items into your Local Office SharePoint Server sites  Content Sources.

To check Local Office SharePoint Server sites 

Shared Services Administration: SharedServices1 > Search Administration > Content sources

http://moss1:8888/ssp/admin/_layouts/listcontentsources.aspx

Edit  the Local Office SharePoint Server sites content source

In the Start Addresses section should be the following items

http://(server): (port)/ (SSP)

http://(portalsite)/ (URL of main portal site)

sps3://(server): (port)/ (My Site Host)      Crawl Settings:

Crawl Schedules: At 12:00 AM every day

: Every 2 hour(s) from 7:00 AM for 14 hour(s) every day

Updating the  Local Office SharePoint Server sites fixed my problem.

InfoPath 2007 – There has been an error while loading the form

You updated an existing template with some new fields and data connections then published the form to the library. now users are unable to open any of the older forms they had saved. before the current update users were able to open all the forms with ie.

Error:

There has been an error while loading the form.
 
Click Try Again to attempt to load the form again. If this error persists, contact the support team for the Web site.Click Close to exit this message.

This form template is not currently browser-enabled. It must either be republished as a browser-enabled form, or opened using Microsoft Office InfoPath 2007.

—————————–

the problem is the older forms are referencing the old template, in my case it was templateOLD.xsn. All i had to do was update all the old forms… below is a block of code that will help you do this. (the forms Modified date and Modified by will change to the current date and the users name that is updating the forms)

Imports System.Text.RegularExpressions

Dim sPath As String
Dim sText As String

For Each file As String In IO.Directory.GetFiles(“\\sharepointed.com\ehaze”) ‘location of your doc library

sPath = file
sText = My.Computer.FileSystem.ReadAllText(sPath)

sText = Regex.Replace(sText, “templateOLD.xsn”, “template.xsn”)

My.Computer.FileSystem.WriteAllText(file, sText, False)

Next