You need to sign in to do that
Don't have an account?
SFDC_Learner
User and system mode
Hi
Apex Sharing Class:
public with sharing class TestCls {
public TestCls(){
myweb.dologic();
}
}
=====
// Webservice class
Global class className{
dologic();
}
In this case What is the apex code execution mode. is it in user / system?
Because all webservices will execute in system mode. But sharing class will execute in user mode.
When we call a webservice method from sharing class.. what is the final execution mode?
Hi,
Final execution mode will be System mode As you are calling a method which is defined in Web Service.
The sharing setting of the class where the method is defined is applied, not of the class where the method is called. For example, if a method is defined in a class declared with with sharing is called by a class declared withwithout sharing, the method will execute with sharing rules enforced.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_keywords_sharing.htm
mark it as solved if the solution worked as it might help others..!!
Thanks,
Prashant Tiwari
Hi ,
As Webservice class is the one which executes it will run in System mode.
Is the class wrtiing for testing the code?
Regards,
Ashish
http://salesforce.stackexchange.com/questions/16121/sfdc-understanding-with-sharing-without-sharing-unspecified-sharing-classes
In short, if you don't specify sharing, the calling class gets to choose if sharing is applied or not.