function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cw.ax43cw.ax43 

Instance-level metadata

Hi,

Is it likely that a future version of the API would provide a call to determine if a particular object instance is editable and deletable -- Perhaps if the base SObject class had an "updateable" and a "deletable" element whose values would indicate, respectively, if the caller is able to update and delete a particular object instance that it has retrieved?  These elements would be similar to the "updateable" and "deletable" elements that are returned in the DescribeSObjectResult, but different in 2 ways: (1) they are at the instance level rather than the class level; and (2) they are based on the organization-wide sharing that is in effect and also possibly whatever AccountShares and OpportunityShares that have been defined.  What I'm trying to do is to answer the question "Can I update/delete this Account that I've retrieved?" so that I can consistently enforce constraints on custom objects that are linked to the Account -- e.g., if the caller can't update a particular Account I don't want him to be able to update a custom object instance that is linked to that Account, either.

Theoretically it is already currently possible for us to determine this information, but it requires explicitly making numerous calls to get the current settings for the organization-wide defaults as well as querying AccountShares and OpportunityShares and perhaps even Roles and Groups/GroupMembers.  It would be a lot nicer if the API could provide a call (or to return the information as part of each returned SObject instance if requested) rather than us having to essentially re-implement SFDC's sharing model/rules in order to manually determine these answers.

Thanks in advance.