You need to sign in to do that
Don't have an account?
FATAL_ERROR System.QueryException: sObject type 'AssignmentRule' is not supported.
I'm creating cases thru a community and using VF/Extention to submit to dB.
Now I do notice that when I remove with charing from my controller extension it works but that would mean all sharing rules are ineffective which is not really helping. I also would like to stay away from doing this in after update trigger as some case need to run thru assignment rules and some don't so I need to include the login there.
Is there another way .. like for example a method inside a utility class ... some samples would be great. Many thanks in advance.
AssignmentRule CaR = new AssignmentRule(); CaR = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1]; System.debug('** * ** Controller || Retrieve Case Assignment Rule ...'); Database.DMLOptions dmlOpts = new Database.DMLOptions(); dmlOpts.assignmentRuleHeader.assignmentRuleId= CaR.id; objCase.SetOptions(dmlOpts);When creating case I get the following error: sObject type ÁssignmentRule'is not supported.
Now I do notice that when I remove with charing from my controller extension it works but that would mean all sharing rules are ineffective which is not really helping. I also would like to stay away from doing this in after update trigger as some case need to run thru assignment rules and some don't so I need to include the login there.
Is there another way .. like for example a method inside a utility class ... some samples would be great. Many thanks in advance.
Thanks but finally I used
You can only have one active (& default) case assignment rule .... there's no need to query... and therefore no need to create class with/without sharing.
All Answers
May I suggest you please refer the below link for reference.
- https://developer.salesforce.com/forums/?id=906F00000008rUlIAI
Hope it helps.Please mark it as best answer if the information is informative.
Thanks
Rahul Kumar
Thanks but finally I used
You can only have one active (& default) case assignment rule .... there's no need to query... and therefore no need to create class with/without sharing.