• beefy911
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

This doesn't work:

 

trigger cdAssignment on Case bulk (before insert) {
...snip...
for (case c : trigger.new){
if (c.RecordTypeId == rtRequest)
{
// c.OwnerId = requests.get(c.Request__c).OwnerId;
}
else if (c.RecordTypeId == rtPaymentR)
{
// c.OwnerId = paymentRequests.get(c.Related_Payment_Request__c).OwnerId;

system.debug(c);
// below is a valid id that i used to test and it still fails
c.OwnerId = '005700000014h0xAAA';
system.debug(c);
}
}

}

This works:

 

trigger cdAssignment on Case bulk (before insert) {
...snip...
for (case c : trigger.new){
if (c.RecordTypeId == rtRequest)
{
c.custom__c = 'blah blah...';
}
else if (c.RecordTypeId == rtPaymentR)
{
c.custom__c = 'blah blah...';
}
system.debug(c);
}

}

 

Here's a snipplet of my code, the initial user creating the case is a portal user and once they click submit it should change the owner to an internal user of my choosing. But right now it is giving me an error:

 

Insufficient Privileges You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

 

I can save and make changes to any field on the case object besides OwnerId. Here are some things I tried:

- Giving the profile create/read/write permissions to that object

- Double check that the field accessibility was set to Editable for that recordtype

 

I don't know where else to look, does anybody have any suggestions?