function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
arundevarundev 

statusCode:'INVALID_FIELD_FOR_INSERT_UPDATE"

Hi,
When I am updating the ParentId in "CaseComment" with the another ParentId.Then I got an error:-
""Please check the security settings of this field and verify that it is read/write for your profile.', statusCode:'INVALID_FIELD_FOR_INSERT_UPDATE', },""
And when I traced the error then I found a message "Check Modify date Premission for your profile in security setting".


   var cCase=new sforce.SObject("CaseComment");
       cCase.Id=SourceCaseCommentId;
       cCase.ParentId=TargetParentid;
     var result = sforce.connection.create([cCase]);


Please Help....
werewolfwerewolf
You can't change the parent ID of a case comment -- case comment is master-detail to case, and you can never change the parent ID of a master-detail.  You have to create a new, duplicate case comment and set its parent ID.
arundevarundev
Thanks for reply...

when I am creating a duplicate record in CaseComment table. Than only these three fields are creating c.CommentBody, c.IsPublished,c.ParentId  by values .

Is the rest of the fields (c.CreatedById, c.CreatedDate, c.Id, c.IsDeleted, c.LastModifiedById, c.LastModifiedDate, c.ParentId)       will auto create.


Thanks...

werewolfwerewolf
Yes, all those fields (except ParentId) will be autofilled when you make a comment.  You just have to set the ParentId and the body, and IsPublished if you want.
arundevarundev
Thanks.....