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

On our solution (SP Foundation) we multiple lists with quite some lookup fields. Some of the lookup fields are user fields who link to the user info list, and we don't want that to happen.

enter image description here

Of course, we can limit the access of the (user info) list itself, but it's not a nice solution when the user clicks on the lookup field, and lands on a access denied page.

The question is: Is it possible to remove the link from the lookupfield? If yes, how?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

Your best bet would be to remove that field/column from the Public view and all other views where you dont want to see it.

If you still want to see the value, create a calculated column which extracts the value from the lookup column and displays that. use the =TEXT calculated column

Hope this helps.

share|improve this answer
    
Thanks for the quick answer, that'll work fine for me. :) –  Markus Schwalbe Jul 12 '11 at 8:14
3  
Lookup Columns are not available in Calculated Columns –  theChrisKent Aug 30 '12 at 20:08
    
As another user mentioned, I'm not sure why the calculated column was marked as answer as SharePoint does not allow me to use look up fields within the formulas. I do not mean to be rude, but it is personally confusing. –  user3299197 Jun 27 at 16:54

The previous answer is really not a solution it is just workaround. You best bet is not to remove field or create some calculated field o just use what SharePoint can give to you. First you should create xsl in mapped folder \14\TEMPLATE\LAYOUTS\XSL for example UsersInfoViewStyles.xsl and add content like in image bellow changing field internal name to you lookup field: enter image description here

Second step is to change XslLink to your created xsl file of view defined in schema.xml file like in image bellow: enter image description here

This will take off links from you lookup field in view. I hope this helps someone in the future.

share|improve this answer

I used jQuery to remove the links by selecting all anchor tags pointing to the look up list (check the href for each of the look up values and they should all start pointing to some list and have an "ID=" at the end). I then unwrapped it from the tags to just return the text. Here is the code line for my list, but you will of course need to change it to the one your look ups are pointing towards:

$(document).ready(function()
{
     $('a[href*="https://mytest.com/sites/MySite/_layouts/listform.aspx?PageType=4&ListId={DERGERG23THE-CH2E-4Y24-9F9C-434E63RT462RER}&ID="]').contents().unwrap();
}
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.