• glynno
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

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?

 

Curious to know if we can use the dataloader to import a chatter attachment?

 

1. We 1st import 1000 contacts

2. We then use the salesforce id and upload the associated document to a chatter message.

 

We do it with regular attachments but need to use Chatter for this use case.

 

Thanks