+ Start a Discussion
mariappangomathirajmariappangomathiraj 

System.DmlException (CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Entity is read-only: FeedItem: [])

I have inserted the FeedItem in trigger(after update).But i got the following exception.

 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Entity is read-only: FeedItem: 

 

I have enabled Enable option in Chatter Settings.Can any one help to solve this above DML exception in Trigger?

hitesh90hitesh90

Hi,

 

can you post your code here so i can help to you what you have to do.

 

Thanks,

Hitesh Patel

Prakash@SFDCPrakash@SFDC

You are writing the trigger for after update . So when it is in update mode it is read only . you are trying to update the same record before the original updation happne . This is a common problem in after update trigger . Debug your code Properly . It would be better if you  post the code here.

mariappangomathirajmariappangomathiraj

I'm using below code in trigger.

post.ParentId = finalList[0].Asset__r.Deal__r.Id; 
post.Body = chatterContent;
post.Type = 'TextPost';
fList.add(post);

 

It is workig for Internal user and getting error for site user.

SanjaySSanjayS

Check  the Profile settings for the site users. There may be some difference on the objects permissions.

mariappangomathirajmariappangomathiraj

Thanks Sanjay.I have inserted the custom object in Site user.This time i have inserted my Feed item in that trigger.Now I got this above read only error.Can you explain which objects permissions I can do in Profile settings for the site users?

 

 

Prakash@SFDCPrakash@SFDC

i think you should give write option to that profile .

mariappangomathirajmariappangomathiraj

Thanks prakash.Which options I will give to that profile?

SanjaySSanjayS

 

Check the permissions the Site User. See you have selected appropriate permission to the Objects for the Site user.

Setup->Develop -> Sites and Force.com Site detail page. 

Click on  Access Settings and check the permission.

If you haven't setup an appropriate authority for the user then the user will  'guest' profile.