You need to sign in to do that
Don't have an account?

Apex code access inconsistencies in Customer Portal
We have a simple trigger that takes the name of the owning group of a case and assigns that value to a field on the case for easy reporting & view creation. This trigger works fine in tests as well as for regular SFDC users. However, this trigger throws an exception when it is executed during the creation of a case from the customer portal.
The trigger:
Map queues =
new Map([select id, name from Group where type = 'Queue']);
for (Case ca : Trigger.new) {
if(queues.containsKey(ca.ownerId)) {
ca.escalation_group__c = queues.get(ca.ownerId).name;
}
}
}
The Customer Portal Exception:
Apex trigger updateEscalationGroup caused an unexpected exception, contact your administrator: updateEscalationGroup: compiling trigger body caused by: line 3, column 26: sObject type 'Group' is not supported.
From what I've read I thought apex code was not limited by the object access of the executing user. At first glance this does appear to be a permission issue, but I have not been able to find any way to effectively change it.
Thanks,
-Tyler
The trigger:
Map queues =
new Map([select id, name from Group where type = 'Queue']);
for (Case ca : Trigger.new) {
if(queues.containsKey(ca.ownerId)) {
ca.escalation_group__c = queues.get(ca.ownerId).name;
}
}
}
The Customer Portal Exception:
Apex trigger updateEscalationGroup caused an unexpected exception, contact your administrator: updateEscalationGroup: compiling trigger body caused by: line 3, column 26: sObject type 'Group' is not supported.
From what I've read I thought apex code was not limited by the object access of the executing user. At first glance this does appear to be a permission issue, but I have not been able to find any way to effectively change it.
Thanks,
-Tyler
"sObject type 'Group' is not supported."