locked
SharePoint 2010 BCS Column to a hyperlink in List RRS feed

  • Question

  • I have created an external content type from a sql server and am displaying the data in SharePoint but need to have one column a clickable HREF tag (actually a UNC path to a file on the LAN). I want the Users of the List to be able to click the item in the list and for it to call the UNC Path to the file and  open the file.
    Tuesday, June 7, 2011 3:55 AM

Answers

  • All the above is done in SPD in the list view (you select the external list from Lists and Libraries and on the right, you edit the default view (top right). You should see your data. Right-click any value under the column you want to hyperlink, select format item as --> hyperlink to --> display form (and click ok if you get a dialog). Now, mouse-over the same value and you should see an arrow inside a square next to it. Click it and you'll get a context menu with one option "hyperlink options". Click that and accept the dialog. The "text to display" should be fine, but the "Address" goes to the form and this is the one you need to change.
    AK
    • Marked as answer by KellyMyhre Saturday, June 11, 2011 2:19 PM
    Tuesday, June 7, 2011 6:39 PM

All replies

  • You can edit the view in SPD and adjust the xslt web part by setting a column to be formatted as hyperlink and you can specify the text to display and the address (either based on column value or some combination of strings - you have the fx at your disposal).
    In SPD, highlight a cell content, right-click and select format item as - hyperlink to ... (select display form, for example). Then, back to same item, click the arrow next to it and you get an additional task:hyperlink. Edit as appropriate.
    AK
    Tuesday, June 7, 2011 12:21 PM
  • I am unable to right click on the column on the display form. As soon as I right click, it highlights the entire webform and I can't access an individual  field.

    Tuesday, June 7, 2011 6:06 PM
  • All the above is done in SPD in the list view (you select the external list from Lists and Libraries and on the right, you edit the default view (top right). You should see your data. Right-click any value under the column you want to hyperlink, select format item as --> hyperlink to --> display form (and click ok if you get a dialog). Now, mouse-over the same value and you should see an arrow inside a square next to it. Click it and you'll get a context menu with one option "hyperlink options". Click that and accept the dialog. The "text to display" should be fine, but the "Address" goes to the form and this is the one you need to change.
    AK
    • Marked as answer by KellyMyhre Saturday, June 11, 2011 2:19 PM
    Tuesday, June 7, 2011 6:39 PM
  • That is better, but if my text in that field is something like

    FILE://///PBCSCANFS\EROOT\EHC\MANDRN\00200\0026D958.TIF

    how do I put that into the address?

    Tuesday, June 7, 2011 8:25 PM
  • You would have already mapped /pbcscanf/ to a shared or network folder so you concatenate the unc and the part of the field text that completes the path (use concat and substring-after).
    AK
    Wednesday, June 8, 2011 5:42 AM
  • Hi folks!

    Yes, i know, this article is a bit dated, but today i was searching for a solution for SP 2013 und google wasn't really helpful there for.

    But i found this great post from AbedKhooli and tried to port this to SPD2013. And it was successful!

    So, if you try to get those things done in SPD2013, have a look:

    In addition to AbedKhooli's post, you can use this as a workaround for 2013. It's a little bit considerable for you need to have both a 2010 and a 2013 environment to get this working, for, as you all might know, in SPD 2013 thers is no design view editing a page.

    But nevertheless, you can get this working in 2013 as follows:

    Do as AbedKhooli described in SPD 2010. Of course you will have to have a working external list to get this done.

    Then, when you have formatted your column, switch to code view, find the block within the <xsl>-Tags, open the corresponding page in SPD2013,  copy the hole <xsl>-block to SPD 2013 and have fun!

    To mention briefly, you will have to store your links in database as absolute ones, e.g.:

    http://microsoft.com leeds to http://microsoft.com

    otherwise your data will be taken as a relative link and will be added to the actual url:

    microsoft.com leeds to http://yourserver/lists/yourlist/mircrosoft.com

    Hope, someone will find this helpful!

    BR,

    Sam


    • Edited by Sam Krieger Tuesday, May 5, 2015 10:02 AM typo
    • Proposed as answer by Sam Krieger Tuesday, May 5, 2015 10:02 AM
    Tuesday, May 5, 2015 10:01 AM