SharePoint Config

Ari Bakker's thoughts on customising and configuring SharePoint

Error with published links to Office client applications

with 5 comments

SharePoint allows you to publish SharePoint links so that they appear in Office ‘Save As’ dialog boxes. This is useful if you want to encourage users to save Word, Excel and other Office documents directly into SharePoint rather than the file system as this dialog is shown the first time you save a new file. It allows you to create targeted shortcuts so relevant document libraries and sites are easily accessible when saving Office documents.

office-save-as-sharepoint-sites

In SharePoint 2010 these published links are managed under the user profile service application in a page called ‘Published links to Office client applications’.

sharepoint-2010-published-links-office

We had an issue this week, however, where a client encountered the following error when trying to browse to this page.

The error message stated:

Your search encountered an error. If the problem persists, contact the portal site administrator.

sharepoint-2010-published-links-office-error

There was nothing obvious in the event logs or the ULS logs about this message making it a bit of a mystery as to why it was failing.

After some investigation I found that the problem could be recreated by creating a published link that related to an audience and then deleting that audience. Yes that’s right, there is some really shoddy coding going on there and simply deleting the audience through the UI causes the entire published links screen to stop working! As you can’t see the links anymore you cannot delete the affected links. You also can’t undo the audience deletion so you are essentially stuck.

With some digging I found the values are stored in the SharedListSync table of the Profile DB relating to the user profile service application. As deleting information out of the SharePoint databases risks causing worse problems (not to mention leaving your farm in an unsupported state) I had a look at how the UI handles the deletion when the page is working and found a much better workaround.

If you add a checkbox to the page with a value that matches the ID of the link in the database you can delete the affected links. This is basically mimicking the checkboxes that would be on the page if it rendered correctly. You can then select the checkbox and use the delete button in exactly the same way SharePoint allows you to i.e. in a supported manner. This is shown below:

sharepoint-2010-published-links-office-checkbox

Note the highlighted checkbox that has been manually inserted into the DOM by editing the HTML mark up. The value=”1” will mean that the link with the ItemId of 1 in the database will be deleted. Determining the ID’s to delete does require access to the Profile DB but this can be done by taking a backup of the affected database and restoring it in a test environment if you don’t have access to live data. What you need to look for is the ItemId field in the SharedListSync table.

sql-sharedlistsync-table

The values in the TargetTo column relate to an audience stored in the Profile_SearchAudienceTable. In this case we can see that the row with an ItemId of 2 has an audience so this would be the item to delete if there was a problem.

To add the checkbox to the page you can use tools such as Firebug for Firefox or the IE Developer toolbar. In either tool you just need to select the HTML tab, click edit and insert an input element with type=”checkbox” and a value matching the ItemId of the row to delete. For example to delete the row with ItemId of 2 you could insert the following.

<input type="checkbox" id="CheckedLinks1" value="2">

You need to make sure the input element is within the FORM tag of the page but it doesn’t matter where you put it. For example the screen shot below shows how you can edit the HTML using the IE developer toolbar to add the tag directly after the opening FORM element. This will place the checkbox to delete the item at the very top of the page.

ie-dev-toolbar-published-links-checkbox

If you have multiple items to remove you can add in multiple input elements, select all the items and delete them at once. Once you have deleted the links with missing audiences the screen should return to a usable state.

sharepoint-2010-published-links-office-working

Post to Twitter Post to Delicious Post to Digg Post to Reddit Post to StumbleUpon

Written by Ari Bakker

June 30th, 2011 at 12:30 pm

Posted in 2010,Errors

Tagged with , , ,

5 Responses to 'Error with published links to Office client applications'

Subscribe to comments with RSS or TrackBack to 'Error with published links to Office client applications'.

  1. Thanks so much for this great post. I found myself in this place when I deleted and audience before the link. Simple mistake but wow! I couldn’t get around it. This post really saved the day. Thanks

    Patrick McCoy

    18 Nov 11 at 8:07 pm

  2. Thanks so much for this great post. You saved me a lot

    V

    30 Nov 12 at 8:45 pm

  3. Thanks a lot for this hint!

    I have found another option, which might be a bit easier to achieve if you have more details on the published link which caused the issue:

    1) Recreate the deleted audiences
    2) In the SharedListSync table of the Profile DB, query a search for the URL or Title of the “corrupted” published link.
    3) Note the value in the “ItemID” column
    4) Open the non-functional “Published Links to Office client applications” GUI in central admin.
    5) Append “&ID=” without the quotes to the URL
    6) Re-add the deleted audiences (should be represented by non-resolving GUIDs before the fix)
    7) Enjoy a working GUI (hopefully)

    It is unbelievable that this is still an issue even in SP 2013…

    Fabian

    9 Mar 15 at 3:22 pm

  4. (missed the ItemID in my previous post)

    Thanks a lot for this hint!

    I have found another option, which might be a bit easier to achieve if you have more details on the published link which caused the issue:

    1) Recreate the deleted audiences
    2) In the SharedListSync table of the Profile DB, query a search for the URL or Title of the “corrupted” published link.
    3) Note the value in the “ItemID” column
    4) Open the non-functional “Published Links to Office client applications” GUI in central admin.
    5) Append “&ID=ItemID_from_Step_3_goes here” without the quotes to the URL
    6) Re-add the deleted audiences (should be represented by non-resolving GUIDs before the fix)
    7) Enjoy a working GUI (hopefully)

    It is unbelievable that this is still an issue even in SP 2013…

    Fabian

    9 Mar 15 at 3:28 pm

  5. (Third time’s the charm)

    Thanks a lot for this hint!

    I have found another option, which might be a bit easier to achieve if you have more details on the published link which caused the issue:

    1) Recreate the deleted audiences
    2) In the SharedListSync table of the Profile DB, query a search for the URL or Title of the “corrupted” published link.
    3) Note the value in the “ItemID” column
    4) Open the non-functional “Published Links to Office client applications” GUI in central admin.
    5) Take note of the application ID in the URL and change the URL to the following scheme: https://YOUR_CENTRAL_ADMIN_URL/_layouts/15/EditLink.aspx?LinksType=2&ApplicationID=YOUR_APPLICATION_ID_FOR_PUBLISHED_LINKS&ID=ITEMID_TAKEN_FROM_PROFILE_DB (Step 3)
    6) Re-add the deleted audiences (should be represented by non-resolving GUIDs before the fix)
    7) Enjoy a working GUI (hopefully)

    It is unbelievable that this is still an issue even in SP 2013…

    Fabian

    9 Mar 15 at 3:57 pm

Leave a Reply

*