You need to sign in to do that
Don't have an account?
Dharanesh
Without Sharing for only one DML statement in a sharing class
Hello All,
I have a controller which is currently in with sharing mode. In that class there are lot of DML statements and i need to execute one of the DML statement in without sharing mode. Is this possible? If yes how?
Thanks in Advance.
I have a controller which is currently in with sharing mode. In that class there are lot of DML statements and i need to execute one of the DML statement in without sharing mode. Is this possible? If yes how?
Thanks in Advance.
try something like below,
Try to putting your with out sharing DML statement in seprate class and call that invoke that class method in with sharing class constructer or where you want refer.
something like below,
without sharing class with DML statement
with sharing class also included without sharing class method,
it works in my org without having any error,
the above solutions is not worked for you. kinldy refer below 2 URLs for the same issue read that very carfully. its may helps to get some Idea.
http://salesforce.stackexchange.com/questions/16121/sfdc-understanding-with-sharing-without-sharing-unspecified-sharing-classes
http://salesforce.stackexchange.com/questions/73392/does-with-sharing-only-apply-to-1st-entry-point-of-code
Hope this will Help you,
Mark Best ANSWER if its works or you have clear these points.
Thanks
karthik
Thanks for the help, i will give it a try.