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
<apex:pageblock>
Add comment: <br></br>
<apex:inputTextarea value="{!AModel.Comment.Body}" rows="3" cols="80" />
<apex:commandButton action="{!AModel.saveOnBehalfComment}" value="Save" id="saveCommentButton" />
<apex:pageblocksection>
<apex:pageBlockSectionItem id="DateTimeofComment">
<apex:outputLabel>Sent Date</apex:outputLabel>
<apex:inputfield id="Date" value="{!AModel.Comment.createddate}" />
</apex:pageBlockSectionItem>
</apex:pageblocksection>
</apex:pageblock>
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;
}
set;
}
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