This is such a daft question, I have created a trigger in my own salesforce dev environment and it works fine. I try and copy this trigger from my org into our company sandbox and I am getting the following error

“Error: Compile Error: Invalid field UserPermissionsKnowledgeUser for SObject User at line 3 column 1”

My trigger is ;

trigger ContentUser on User (before insert) {
    For (User userinloop : trigger.new) {
        userinloop.UserPermissionsKnowledgeUser = true;

UserPermissionsKnowledgeUser = Salesforce CRM Content User field

My dev org salesforce 14 Sandbox salesforce 14

what the hell is happening ?

Regards D

  • Are your sandbox and production dbs identical in terms of objects, fields, etc? The field "UserPermissionsKnowledgeUser" isn't visible in my Salesforce production db.
    – Jagular
    Oct 2 '14 at 15:13
  • field label : Salesforce CRM Content User = UserPermissionsKnowledgeUser
    – user11500
    Oct 2 '14 at 15:17

It sounds like you don't have knowledge on that org or a knowledge license assigned.

  • The salesforce field is "Salesforce CRM Content User" which i belive is api name of UserPermissionsKnowledgeUser
    – user11500
    Oct 2 '14 at 15:17
  • @user11500: No, that field refers to Knowlege. salesforce.com/us/developer/docs/api/Content/…
    – PepeFloyd
    Oct 2 '14 at 15:26
  • OOh PepeFloyd you cheeky minx, i think your right, i think i need the field api name of UserPermissionsSFContentUser :P
    – user11500
    Oct 2 '14 at 15:28
  • Currently this field only gets populated if the user is created, how can i make it fire if the user record is also being edited and saved ?
    – user11500
    Oct 2 '14 at 15:30
  • @user11500: Instead of (before insert), do (before insert, before update)
    – PepeFloyd
    Oct 2 '14 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.