Salesforce
CRT-450 · Question #123
Given the following code snippet, that is part of a custom controller for a Visualforce page: In which two ways can the try/catch be enclosed to enforce object and field-level permissions and…
The correct answer is A. Use if (Schema, sobjectType, Contact, isUpdatable ( ) ) B. Use if (Schema , sobjectType. Contact. Field, Is_Active_c. is Updateable ( ) ). See the full explanation below for the reasoning.
Question
Given the following code snippet, that is part of a custom controller for a Visualforce page:
In which two ways can the try/catch be enclosed to enforce object and field-level permissions and prevent the DML statement from being executed if the current logged-in user does not have the appropriate level of access? Choose 2 answers
Exhibit
Options
- AUse if (Schema, sobjectType, Contact, isUpdatable ( ) )
- BUse if (Schema , sobjectType. Contact. Field, Is_Active_c. is Updateable ( ) )
- CUse if (Schema.sObjectType.Contact.isAccessible ( ) )
- DUse if (thisContact.Owner = = UserInfo.getuserId ( ) )
How the community answered
(40 responses)- A73% (29)
- C18% (7)
- D10% (4)
Community Discussion
No community discussion yet for this question.
