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

I have two lists: Projects and Tasks

In the Tasks list, I have created a lookup field titled ProjectID which targets ID filed from the Projects list. Also, I have set for this field to display an additional field ProjectID: Title. So, when I view the tasks I see the values for the particular project ID and Title.

However, on the display form for the Tasks I can only see the ProjectID field. I've modified the display form to hide the default display web part and created a custom one in order to be able to customize the fields presentation. Now I have two problems:

  1. ProjectID field is displaying the whole <a... /> tag instead of just the value for the ID (which should act as a link to the related project item)
  2. I can't find a way to display the ProjectID:Title field at all. I tried:
    <td width="400px" valign="top" class="ms-formbody">
        <xsl:value-of select="@ProjectID_x003a_Title" />
    </td>
    but the field is just blank.

Is there a way to be able to show lookup additional field in the display form?
Thanks.

share|improve this question
    
Is there a solution to that question after more than a year now? I need this, too. Look here: http://sharepoint.stackexchange.com/questions/74523/sp2010-how-to-display-a-loo‌​kup-column-in-a-aspx-displayform –  KarstenK Aug 7 '13 at 12:59
add comment

2 Answers 2

[There was a not useful answer]

UPDATE: OK, I understand the problem now. In my case the field is present in the section (I've removed other fields for simplicity):

<DataFields>@MultiLookupTest_x003a_TestField,MultiLookupTest:TestField;</DataFields>

And then you can render it just in the same manner as others but you need to use a part of identifier:

<xsl:value-of select="@MultiLookupTest_x003a_TestField"/>

Unfortunately you'll get your projected value in the same form of tag. But here there's an advice:

I found another solution by selecting the cell and clicking "format as label".

Maybe it hepls you.

share|improve this answer
    
By default it works fine, but if you want to customize it then the problems appear. Open the DispForm.aspx in SharePoint Designer. Next, hide the default display web part. Next, go to Insert > SharePoint > Custom List Form and choose the same list and item display form type. The lookup field will get screwed up as described in the question and the lookup additional field will be missing and so on. –  Boris Feb 28 '12 at 12:03
add comment

You can set "readonly" property of your additional field to FALSE (by code or sharepoint manager, for example). Then this field will be presented in display form.

share|improve this answer
    
Do you mean to do that in the source list or somewhere in the list doing the lookup? And do you mean Sharepoint Designer when you say "sharepoint manager"? –  BGM Aug 3 '13 at 15:23
add comment

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.