exam questions

Exam Certified Sharing and Visibility Architect All Questions

View all questions & answers for the Certified Sharing and Visibility Architect exam

Exam Certified Sharing and Visibility Architect topic 1 question 41 discussion

Actual exam question from Salesforce's Certified Sharing and Visibility Architect
Question #: 41
Topic #: 1
[All Certified Sharing and Visibility Architect Questions]

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.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
roberto_ampl
Highly Voted 1 year, 6 months ago
Selected Answer: 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.
upvoted 9 times
...
syuan0321
Highly Voted 1 year, 5 months ago
B might be right. With out sharing ignores sharing rules is the default model for Apex class
upvoted 5 times
...
BrainMelt12
Most Recent 2 weeks ago
Selected Answer: B
B. is correct. ‘With Sharing’ enforces sharing rules and if that user doesn’t have related object access then access errors will occur. If sharing rules don’t deploy right, then it can be an issue only in prod. A. Triggers run in system mode by default and will ignore sharing rules. C. runAs() can only be used in test classes so it’s not relevant here D. If user can’t create the object’s record, then it will return false. It immediately triggers an dml error bc the user can’t create. It would be caught before deployment and during testing.
upvoted 1 times
...
6967185
6 months ago
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.
upvoted 2 times
...
Rangya
10 months, 2 weeks ago
Selected Answer: B
If it's be D, User won't be getting a message.
upvoted 2 times
...
Nilesh_Nanda
1 year ago
I think B is correct Because IsCreateable() just checks user access
upvoted 3 times
...
LiberPolly
1 year, 2 months ago
Selected Answer: 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
upvoted 3 times
...
mariella_88
1 year, 5 months ago
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
upvoted 5 times
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago