I had created a managed package which performs the following:
- Update the custom fields(part of package) on account object.
- TO Update these fields, I had a scheduler class(say A) which calls a batch class(say B) which inturn calls apex class(say C) that updates the fields on an hourly basis.
- I also have a inline vf page on account object which takes some input and makes a webservice callouts and updates the same custom fields mentioned in point 1 and reloads the account detail page. The controller for this page is same class(class C) which is being called from batch class(class B) mentioned in pt. 2
- I have a post install script which I created tho schedule the apex mentioned in pt. 2(class A)
ALSO see my previous question: Sobject type not supported in Managed Package
SO the flow is:
POST INSTALL script calls class A; Class A calls Class B; Class B calls Class C.
Vf Page also invokes class C.
When I install the package, it was successful. But when the scheduler class runs, I get error saying "sobject type account is not supported".
After some research I found out that, in order for this to work, I need to remove the "'with sharing" keyword from all the classes directly/indirectly referred from the post install classes. This essentially means that all the classes in my package will have to be marked either as "without sharing" or simply none of them needs to have "with sharing" keyword.
Below is a link for reference: Install Script Batch Job failing (sObject type 'Contact' is not supported)
So my question is that is it possible to have my application uploaded on appexchange if all the classes in my package are not marked by "with sharing" keyword?