I having a visualforce page with a controller(without sharing) I have tried both method: - Schema.sObjectType.Opportunity.isUpdateable() - Schema.DescribeSObjectResult - isUpdateable()

Both of them return false. I would expect it return true in (without sharing class)

*Notes: It returns false in sandbox (Winter'20 Patch 12.1). But True in Production.

  • Sharing does not tell you if the object is updateable or not, it just tells you which records you will be able to update. You're looking for the Object Permissions, which are part of the profiles and permissions sets.
    – rael_kid
    Oct 30 '19 at 10:32
  • @rael_kid thanks , i forgot to mention that it return true in production, but return false in sandbox (Winter'20 Patch 12.1) Oct 30 '19 at 10:49
  • Are you sure you have the correct permissions on the object? Have you compared the profiles and permission sets between the sandbox and production?
    – rael_kid
    Oct 30 '19 at 10:56
  • @rael_kid sure, because Site User don't have permission to update Opportunity, that why we use without sharing key words. Oct 30 '19 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.