0

In my apex code for creating a user, I'm setting the following flags which according to the documentation should turn off email alerts for content users

UserPermissionsSFContentUser = false, UserPreferencesContentNoEmail = true, UserPreferencesContentEmailAsAndWhen = false

However, the flag 'Receive Salesforce CRM Content Alerts as Daily Digest' is still being enabled on user creation. Is there something else that I need to do in my code or am I setting something incorrectly?

Any help on this is greatly appreciated.

Many thanks.

1

To disable the flag on the "Receive Salesforce CRM Content Alerts as Daily Digest"preference, you have to set "UserPreferencesContentEmailAsAndWhen" to True, not False.

So the settings should be: UserPermissionsSFContentUser = false, UserPreferencesContentNoEmail = true, UserPreferencesContentEmailAsAndWhen = true.

This works in Data Loader version 23 and higher. You can check out this article:

Is it possible to bulk enable the Salesforce Content Email Alerts settings for all users? https://help.salesforce.com/apex/HTViewSolution?id=000005333&language=en_US

|improve this answer|||||
0

For unknown reasons, you can only set these in an update on User. So you have to trigger an additional update from the User insert trigger.

Note that you cannot do that in the same context, so you will have to make this update in a @future call.

|improve this answer|||||

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.