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'm creating a custom form in SharePoint designer and I'd like to display the value of the "Created By" field in a section of the form. I've done this successfully with other columns in the form.

For example, in SPDesigner, I selected the "Title" field and changed the "Format As" value to "Text". As a result, SPDesigner updated the HTML code to look like this: <xsl:value-of select="@Title" />. The result is that the Title field value is displayed (not editable) in the form.

However, when I try to use the code <xsl:value-of select="@Created_x0020_By" /> to display the name of the person who created the list item - nothing displays in this location on the form.

Can anyone tell me how I can display the list item creator's name in my custom form?

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

This is the way it works for me:

<tr>
    <td valign="top" class="ms-formlabel"><nobr>Created by</nobr></td>
    <td valign="top" class="ms-formbody">
        <SharePoint:CreatedModifiedInfo ControlMode="Display" runat="server">
        <CustomTemplate>
            <SharePoint:FormField FieldName="Author" runat="server" ControlMode="Display" DisableInputFieldLabel="true" /><br/>
            <SharePoint:FieldValue FieldName="Modified" runat="server" ControlMode="Display" DisableInputFieldLabel="true"/>
        </CustomTemplate>
        </SharePoint:CreatedModifiedInfo>
    </td>
</tr>
share|improve this answer
    
That works David! Thanks!!! –  pmartin Nov 4 '11 at 13:16
add comment

Try <xsl:value-of select="@Author" /> instead.

share|improve this answer
    
I think that's a great suggestion - but it does not work. –  pmartin Oct 12 '11 at 18:08
    
That should do it, Author is the internal field name for the Created By column. Something else to try would be to put it on the form as an editable field, then change the layout of the input field to text. –  PirateEric Oct 12 '11 at 18:59
    
Unfortunately, your solution does not work. Please note that I'm dealing with a custom list - not a document library or standard list. This custom list was created based on the Item template and additional fields have been added. –  pmartin Oct 12 '11 at 20:11
    
This is a custom edit form you're trying to make I take it based off of inserting a Custom List Form web part? –  PirateEric Oct 12 '11 at 20:21
1  
Using the @Author attribute won't work. You need to use the Sharepoint CreatedModifiedInfo control (see my answer) –  David Aleu Nov 4 '11 at 11:38
show 2 more comments

I faced similar kind of issue in development. My requirement was to make custom edit form and disable a few fields if the logged in user and the created by of the account was same. I tried retrieving the @Author value using but it always displayed null.

So found a very good solution on it. In designer find the line

Change the ListItem To List. With this you will get all the fields of the list including @Author , @Editor ,@Created and @Modified.

The only issue is you will all the items , so u will have to filter the item based on the id that we get in the querystring

share|improve this answer
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.