Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to have "clickable" URL address in (SP 2010) calculated column without any JavaScript code or Designer?

I found the way how to easily make "universal" Document ID links visible for all documents in our portal thru Search Center, because users don't want to remake all links in documents everytime we change company structure. I created site calculated column for Document content type and users can add this column to any view but link inside is text only. No big deal, but and I want more. My code:

="https://portal/sites/search/Pages/results.aspx?k="&[Document ID Value]

Or is there any other way how to bring this URL to users? Thank you.

[edit] Solved, our developer made a feature for us (and yes, it is a kind of script attach to link in context menu after all...). Thank you

share|improve this question

5 Answers 5

up vote 2 down vote accepted

We've recently released a free HTML Calculated Column; it acts just like a calculated column, but won't escape HTML:

Pentalogic's SharePoint HTML Calculated Column

To produce a clickable link, you'd use the following formula:

="<a href=\"https://portal/sites/search/Pages/results.aspx?k="&[Document ID Value]&"\">Link</a>"

Disclaimer: I work for Pentalogic; on this project actually. Oh, and I'm afraid you have to sign up for our newsletter, but that isn't a bad trade (in my unbiased opinion). :)

share|improve this answer
1  
Stuart, You remember this case after such a long time :) Thank You. Completely without scripts? Sounds great, we can try it on our test farm. You can't imagine what our users did with scripts in old farm... (It cost 156 overtime hours to repair all damages after migration) –  Molik Jan 12 '12 at 19:28

Based on what you describe, it would make more sense to reformat the search results to include the link to the documents the way you describe. By adding a calculated column to every single Document Library, you're incurring unnecessary overhead.

In SharePoint 2007 search (I just haven't looked at 2010, but I'm guessing it's the same), the search results are formatted using XSL, which you can modify to show the link (plus any other metadata) you want.

share|improve this answer
    
Thank you for your answer, but xml change is not what our managers want. We have serious problems with migration from MOSS 2007 to SP 2010 because our content admins inserted scripts or launch designer each time, when they wants something more that SP offered and each customization, even that small, can be problem in the future again. Great situation, because on the other hand, our users don't want to change their links inside documents and wants to quick and easy find document ID (preferably directly from context menu of each document like Check out option). –  Molik Jul 8 '11 at 7:28
    
You're going to build the wrong solution because of mistakes made by others in the past, but of course that's the hand you've been dealt. The "right" answer is the XSL answer. The only way I know of to have the calculated column's value act as a link is to add script to the page to reformat it. See Christophe's HTML calculated column articles. Here's a recent one: blog.pathtosharepoint.com/2010/06/16/… –  Marc D Anderson Jul 8 '11 at 11:36

Do you want to construct a clickable url in the search center?

Then you need to modify the XSLT of the Search Core Results WebPart like Marc said. You can build the following url for instance: http:///_layouts/DocIdRedir.aspx?ID=[DocumentID]. You can reveal the document id with his managed property.

If you want a "clickable" column within a sharepoint list you have several options

  • Modify rendering template of a column. See this blogpost.
  • Create a custom workflow with sharepoint designer to build your dynamic url
  • Create a SPListItemReceiver to build your url field dynamically
share|improve this answer
    
Thank you for your answer, but the same comment as above, our managers don't want that kind of changes. But yes, this can be a solution. –  Molik Jul 8 '11 at 7:29

actually this is much easier than the options above. if you set the data type returned by the calculated column to be Number, then it is interpreted as HTML.

see this link for more details: http://sharepoint.rackspace.com/calculated-columns-tutorial

share|improve this answer

I tried this in SharePoint 2013 Online but didn't work

="<a href=\"https://portal/sites/search/Pages/results.aspx?k="&[Document ID Value]&"\">Link To Document</a>"

It doesn't like the \". As a workaround use single quotes for the URL as follows

="<a href='https://portal/sites/search/Pages/results.aspx?k="&[Document ID Value]& "'>Link To Document</a>" 

This worked although right aligned because of the number format.

Using Date instead of number makes them right aligned but they don't wrap

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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