I have a basic trigger that defaults the owner for accounts and contacts upon lead conversion. After turing on triggers and validations for lead conversions this is mostly working, but in some cases when a user is converting a lead owned by another user they conversion fails with an "Insufficient Privileges" error.

The sharing model is private for leads, accounts, and contacts with grant access via hierarchies enabled. The user converting the lead is in the role above the user who owns the lead. If I disable the trigger, then manually transfer the account as the test user, it works just fine.

Reviewing the debug logs, everything reports success. However, based on the fact disabling the trigger that changes the owner removes the error, it seems like the issue is in there some how ....

Has anyone encountered this sort of error? I'm using a before trigger so there isn't a great way to catch DML errors :(, and given the ambiguous nature of the Insufficient Privileges error I'm at a loss for where to look.



You must log in to answer this question.