126k views
2 votes
Which two lines of code will cause a DML exception on insert to the database when assigning access level for the record? Universal containers has a requirement for the architect to develop Apex managed sharing code for the custom job object. The sharing settings for the Job object are set to Private.

A. Objectname.AccessLevel='Read'
B. Objectname.AccessLevel='Edit'
C. Objectname.AccessLevel='All'
D. Objectname.AccessLevel='None

1 Answer

1 vote

Answer:

C and D where the property name as described in the question is Objectivename.AccessLevel.

Step-by-step explanation:

The answer to the question asked are C which implies that Objective.AccessLevel="All" and D which implies that the Objectivename.AccessLevel="None"

It is good to also know and understand that the narrative in the question and answer to the question are terms used in the Apex sharing sales force.

A share object includes records supporting all three types of sharing: managed sharing, user managed sharing, and Apex managed sharing. Sharing granted to users implicitly through organization-wide defaults, the role hierarchy, and permissions such as the “View All” and “Modify All” permissions for the given object, “View All Data,” and “Modify All Data” are not tracked with this object.

It should also be understood that :

The level of access that the specified user or group has been granted for a share sObject. The name of the property is AccessLevel appended to the object name. For example, the property name for OperateShare object is OperateShareAccessLevel. where valid values are usually,Edit , Read , All

User MrMangado
by
6.1k points