I am trying to change the createddate of a feeditem object using input from the user. What is happening is that, it is working perfectly for System Administrator profile, however for any other profile, the inputfield is showing as blocked, in the UI popup(from where the user was supposed to enter the date value). I have the following piece of code

    Add comment: <br></br>
    <apex:inputTextarea value="{!AModel.Comment.Body}" rows="3" cols="80" />
    <apex:commandButton action="{!AModel.saveOnBehalfComment}" value="Save" id="saveCommentButton" />
        <apex:pageBlockSectionItem id="DateTimeofComment">
            <apex:outputLabel>Sent Date</apex:outputLabel>
            <apex:inputfield id="Date" value="{!AModel.Comment.createddate}" />

In the class I have the following piece of code.

private Transient FeedItem pComment = null;
public FeedItem Comment {
    get {
        if (pComment == null) {
            pComment = new FeedItem();
            pComment.Type = 'TextPost';
            pomment.Visibility = 'AllUsers';
        return pComment;
public void saveOnBehalfComment() {
    Some other code................
    update Comment;

I do not know if its is possible to give a permission to the profile on createddate of feeditem


1 Answer 1


Some of the System fields are not editable. So in other words you can not modify createddate of record. This done by design and there are few exceptions for while performing data migration Salesforce support can allow you to update created date or last modified date for few days but in general its not not mean to be edited by user. If its Critical business requirement for you then you will need to create your own custom datetime field and remove createddate from all layouts and show your custom field with same label.

Here is complete list of field for your reference.


Out of these fields Id , CreatedDate, LastModifiedDate, & SystemModstamp are not modifiable.

  • is there any other way I can pass the data given in the inputfield by the user, to the controller class @AtulRajguru9
    – Rimii
    Jun 7, 2016 at 9:48
  • your commented question does not make sense in context of OP. but in general.. yeah, you can create new field on your controller and pass data in that. Jun 7, 2016 at 12:41
  • no where in my answer(or in question) we talked about Audit fields then why are you mentioning this here. Jun 8, 2016 at 8:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .