Exam Certified Sharing and Visibility Architect All QuestionsBrowse all questions from this exam
Question 24

After testing and deploying a new trigger that creates a related order when an opportunity is closed, the Architect begins receiving complaints of permission error messages appearing when closing an opportunity.

How did this error occur?

    Correct Answer: A

    The error occurred because the trigger handlers class does not use any sharing keywords and the user does not have access to the orders related to the opportunity. In an Apex class, if no sharing keyword is specified, the class runs in system context which can bypass normal sharing rules. This means the user's permissions are not enforced, and if the user does not have access to create or view orders, they will encounter a permission error when the trigger attempts to create the related order.

Discussion
roberto_amplOption: D

i think D is the answer, because A end B are equivalent, default sharing is "With Sharing", and old related order not impact the creation of new one.

mariella_88Option: D

I think D is the right answer. A and B are not relevant for the use case, because to create a new order it is not necessary to have access to already existing orders. And C it is just for test classes

syuan0321Option: B

B might be right. With out sharing ignores sharing rules is the default model for Apex class

Nilesh_NandaOption: B

I think B is correct Because IsCreateable() just checks user access

LiberPollyOption: B

Don't think it is D, because if the trigger was using IsCreateable() to check for permissions before trying to create the Order, there shouldn't be any permission errors

6967185Option: B

B. Since isCreateable() returns true if the field can be created by the current user, false otherwise. Unless I read this wrong, there is no mention of a "field" in this question.

RangyaOption: B

If it's be D, User won't be getting a message.