Timeline for Update of Locked Records works in Future Calls
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 13, 2017 at 12:54 | history | edited | CommunityBot |
replaced http://salesforce.stackexchange.com/ with https://salesforce.stackexchange.com/
|
|
Oct 31, 2013 at 16:38 | comment | added | sfdcfox♦ | The point is about with sharing/without sharing/unspecified sharing. The original question is about why a ENTITY_IS_LOCKED error appears in a function but not when called in a future method. | |
Oct 31, 2013 at 14:30 | comment | added | greenstork | While you FutureHandler method is in future context, nothing about your Limited__c trigger is. The trigger that iterates your counter does not invoke future context. | |
Oct 31, 2013 at 14:27 | comment | added | sfdcfox♦ | The FutureHandler is running in future mode-- the trigger only proves that a valid edit succeeded. | |
Oct 31, 2013 at 14:26 | comment | added | greenstork | This doesn't really prove your point, I don't believe. The reason that your update is failing is because your trigger on Limited is not running. It is not in future context. | |
Oct 31, 2013 at 13:48 | history | edited | sfdcfox♦ | CC BY-SA 3.0 |
added 301 characters in body
|
Oct 31, 2013 at 13:43 | comment | added | sfdcfox♦ | See my answer on SFDC: Understading the Sharing, Without Sharing & Unspecified Sharing Classes for an in-depth discussion on sharing/without sharing. If you want your synchronous function call to always succeed (e.g. from a Visualforce page), explicitly use "without sharing." If you want to always enforce record locks, always use "with sharing." Ideally, you should probably never use the default model (not specified) because it causes this sort of confusion. | |
Oct 31, 2013 at 9:07 | comment | added | Marc | I've updated my question: our class is not "with sharing" - the only difference is the @future annotation. | |
Oct 30, 2013 at 18:46 | history | edited | sfdcfox♦ | CC BY-SA 3.0 |
added 2824 characters in body
|
Oct 30, 2013 at 18:42 | comment | added | sfdcfox♦ | I've updated my answer for your benefit and others that may follow. | |
Oct 30, 2013 at 18:41 | history | edited | sfdcfox♦ | CC BY-SA 3.0 |
added 2824 characters in body
|
Oct 30, 2013 at 17:23 | comment | added | greenstork | I'm fairly certain that future methods run in system context regardless of sharing defined on the class. | |
Oct 30, 2013 at 16:58 | history | answered | sfdcfox♦ | CC BY-SA 3.0 |