You need to sign in to do that
Don't have an account?
glynno
How to write to custom object using Apex
I have an apex trigger that runs when a Chatter message is posted. I also have a custom object. I would like to write text to the custom object from my apex trigger. Everything works fine when an admin user posts a chatter. However, when a non admin user posts a chatter I get an exception:
Apex trigger company.test caused an unexpected exception, contact your administrator: company.test: execution of BeforeUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type: []: (company)
How do I get this to work for non admin users?
This is because of the create permissions on the custom object.
Provide create permissions on the custom object for all profiles of non-admin users.
Regards,
Shravan