function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

insufficient privileges on Partner object?

Hi all,

Some of our users are getting insufficient privileges errors when creating an object but we cant find out why.

I have debugged on FINEST and get no error however what I do see is that when trying to query the Partner table, nothing happens.  No results, no errors, no exceptions - everything just stops.


This doesnt happen for me (admin) I see the results of the query.  For that matter, in this example there actually isnt a result but we catch the exception and deal with it and carry on through the method.


Here is the line of code where the debug log ends:



Partner ptnr = [SELECT AccountTo.Id, AccountTo.Type, Role FROM Partner WHERE IsPrimary = TRUE AND Opportunity.ID = :newOpp.Id LIMIT 1];



and this is the debug output for that line (289):


12:05:25.358 (325898000)|LIMIT_USAGE_FOR_NS|[289]|SCRIPT_STATEMENTS|57|200000
12:05:25.358 (325931000)|STATEMENT_EXECUTE|[289]|DeclareVar: SOBJECT:Partner ptnr
12:05:25.358 (325954000)|VARIABLE_SCOPE_BEGIN|[289]|ptnr|Partner|true



As you can see the code just stops and there is no logging of any issue or the query being run so I imagine there is a priviliges problem with the Partner object?  If so how can I get around this?

We never used to have this problem until we did a revamp of user profiles so it must be some profile issue.


Please can someone help as I cant see where we can modify access to a Partner object but this is causing us major problems!


Thanks so much.