1

Given a database table with following columns: ID, TEXT, URL. This table contains some useful links to external sites. In Sharepoint 2010 we have added this table as a custom search source. How to map an URL of a search result item to the text containing in URL column from our data record.

Example (what we have):

Google search

Click here to open google site

http://www.sharepointservername:46197/profilepages/_bdc/http___localhost_46197_bcssearch/services_1.aspx?id=3

Example (what we need):

Google search

Click here to open google site

http://www.google.de

2

You have two issues that can be solved by adding the DisplayUriField to both the finder and specific finder of your BCS model file. Set the DisplayUriField attribute to the name of the URL field.

You should also implement a profile page location in your BCS Service Application that points to a location your users can browse to (other than http://www.sharepointservername:46197, but that will only help your other bus sources.

Link: http://msdn.microsoft.com/en-us/library/office/gg294165(v=office.15).aspx

1

In case anyone is interested, if you've got a SharePoint search result page and you want to update the links to point to a custom page instead of the list items's default display view, here is a little script you can add to the search result page.

Below, my list name is MyCustomList and I want when I click on something to instead of going to the default display view to go to my page MyCustomArticlePage and pass in the ID of the item:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$(window).load(function() {
setTimeout(function() {
    $('a[href*="MyCustomList"]').each(function() {
var oldUrl = $(this).attr("href"); 
            var newUrl = oldUrl.replace("/Lists/MyCustomList/DispForm.aspx?ID=", "/pages/MyCustomArticlePage.aspx?ItemID="); // Create new url

            $(this).attr("href", newUrl); 
});

    }, 
1000);

$('a[href*="MyCustomList"]').each(function() {
var oldUrl = $(this).attr("href"); 
            var newUrl = oldUrl.replace("/Lists/MyCustomList/DispForm.aspx?ID=", "/pages/MyCustomArticlePage.aspx?ItemID="); // Create new url

            $(this).attr("href", newUrl); 
});

});
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.