QUESTION:
I have been notified of the following error but cannot locate what is triggering it or identify how to correct it. Any suggestions?
DupeBlocker has encountered an error. Please contact your Salesforce
administrator with the following information:
*** Trigger: Contact after update
*** isMerge value: false
*** Trigger.new size: 1
*** Trigger.old size: 1
*** Exception Type: System.QueryException
*** Exception Cause: null
*** Exception Message: sObject type 'Contact' is not supported.
ANSWER:
This is a relatively new error that started appearing approx March 2013. It seems to be triggered by another installed managed package that is either inserting or updating Contacts as the package's "install user" which NO LONGER exists once the install is complete (only valid when the application is physically installed).
DupeBlocker has the ability to enforce or not enforce Salesforce sharing when checking/reporting duplicates (i.e. only report a duplicate if the user doing the update has access to both the duplicate records). The problem stems from not being able to even check the permissions of the installed user because it no longer exists, and hence DupeBlocker errors out. The error will only occur when a record being updated by the install user is a duplicate to another record, which is why it will not be triggered EVERY time this process is run, only occasionally.
One third party application that we have identified as causing this error is "Rollup Helper". This application appears to be popular with NFP customer's as it can do a roll-up of donations for contacts. It is likely used by non-NFP's as well, but we are pointing out the NFP connection as we have primarily seen this error from our NFP users. This particular application creates scheduled jobs DURING the installation, which results in them being run as that special "install" user instead of a particular user in the instance.
NOTE: This is just one example, there are likely other third party managed packages that are running jobs as the install user. This application is only mentioned by name as it is the one that was found when troubleshooting this error on an NFP customers org.
To confirm a third party application is causing the issue:
1. Check for third party triggers on the contact object that are updating or inserting records.
2. In Salesforce go to Setup -> Monitoring -> Apex Jobs and check for any jobs that are being run by a third party user (i.e. an install user) that insert/update contacts
3. Check the date/time of the DupeBlocker Errors and confirm they are being generated during the same time period that the Apex Jobs are being run
- Remember, the error may not be generated EVERY time the process is run, it triggers ONLY when there is a duplicate to one of the records being inserted/updated
To resolve:
1. Ensure the latest version of DupeBlocker is installed. We did have one instance where a user was running a VERY OLD version of DupeBlocker and simply updating to the latest release resolved the issue.
2. Contact the developers of the third party application and suggest that they change their process such that their scheduled jobs are run by a user within the org vs. the install user. It is very likely this will or has caused issues with other managed packages (not just DupeBlocker) that require checking the modifying users permissions (has security checking turned on).
3. In the meantime (i.e. if the third party application still runs as the install user), check the "Bypass Security" checkbox in the scenario(s) such that DupeBlocker DOES NOT try and check permissions.
NOTE: Option 3 is only viable for public sharing models, or private sharing models that wish to bypass security.
For private models that want to enforce security when checking for duplicates (i.e. only report the duplicate when the person doing the insert/update has access to both contacts), the only option is to contact the third party vendor that has set up jobs to run as the install user and have them update their code to allow the org to pick a valid user to run the jobs.