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 content type in I need two fields Submitter and Date Uploaded which would have the same values are CreatedBy and Created How do I define it? I have the following definition

Field definitions

    <?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Field ID="{3C700F8D-A421-404B-B6C6-DC3D66FDFBB7}" Type="User" Name="Submitter" ShowInNewForm="FALSE" DisplayName="Submitter" Description="Person who submitted the statement.">
    <FieldRefs>
      <FieldRef Name="CreatedBy" />
    </FieldRefs>
    <DisplayPattern>
      <MapToContentType>
        <Column Name="CreatedBy" />
      </MapToContentType>
    </DisplayPattern>
  </Field>
  <Field ID ="{BE5810A3-2947-4DE1-AC2D-2CA87E18F8D0}" Type ="Computed" Name="DateUploaded" ShowInNewForm="FALSE" ShowInEditForm="FALSE" DisplayName="Date Uploaded" Description="Date statement was uploaded.">
    <FieldRefs>
      <FieldRef Name="Created" />
    </FieldRefs>
        <DisplayPattern>
      <MapToContentType>
        <Column Name="Created" />
      </MapToContentType>
    </DisplayPattern>
  </Field>
 </Elements>

Content Type definition

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Document (0x0101) -->
  <ContentType ID="0x010100116625b359fe4441ba033e7175911437"
               Name="Statement"
               Group="Custom Content Types"
               Description="Statement Content Type"
               Inherits="TRUE"
               Version="0">
    <FieldRefs>
      <FieldRef ID="{3C700F8D-A421-404B-B6C6-DC3D66FDFBB7}" Name="Submitter" />
      <FieldRef ID="{BE5810A3-2947-4DE1-AC2D-2CA87E18F8D0}" Name="DateUploaded" />
      <FieldRef ID="{7A9C198E-D843-4A68-ADA7-6666B0B296D0}" Name="Issues" />
      <FieldRef ID="{B4DF0D6A-D5F4-458A-A55F-558397008D63}" Name="StatementMonth" />
    </FieldRefs>
    </ContentType>
</Elements>

But this isn't working. Should I be using calculated columns instead?

share|improve this question

1 Answer 1

Keep in mind that the actual field for Created By is "Author" so you should use that instead.

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.