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?
A.
The trigger handlers class does not use any sharing keywords and the user does not have access to the orders related to the opportunity.
B.
The trigger handler class is using “with sharing” and the user does not have access to the orders related to the opportunity.
C.
The trigger should be using RunAs() when creating the order.
D.
Trigger is using IsCreateable() Apex method and the user doe not have create permission on the Order object.
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
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.
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
B might be right. With out sharing ignores sharing rules is the default model for Apex class
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
roberto_ampl
Highly Voted 1 year, 3 months agomariella_88
Highly Voted 1 year, 3 months ago6967185
Most Recent 3 months, 4 weeks agoRangya
8 months, 1 week agoNilesh_Nanda
10 months agoLiberPolly
1 year agosyuan0321
1 year, 3 months ago