nerdexam
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

CRT-450 question #123 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)
  • A
    73% (29)
  • C
    18% (7)
  • D
    10% (4)

Community Discussion

No community discussion yet for this question.

Full CRT-450 Practice