Challenge 2: Record-Level Security Settings
I created the three user profiles last time, so the starting point tonight was the next tier of security - roles. I set up the roles per the provided org chart, making sure to follow the opportunity restrictions from the directions.
Next, I set up the required user and assigned her to the correct profile and role.
Hint: Use a real email address for Samantha Cordero. You will need to login as Samantha in order to create an opportunity for her. While you are at it, go ahead and login to Salesforce1 as Samantha.
Once Salesforce1 is enabled, you can set up the appropriate permissions. You may want to take take a peek at a Salesforce Knowledge Article.
Me - as a Project Manager. |
Next, I addressed the special role - Project Managers
Project Managers require a role, permission set, and a sharing rule.
Whew!
For the final step, I set up the remaining sharing rules in order to ensure that users with the Inside Sales profile have access to edit and see all accounts and opportunities. You can check out my configuration below, but it's burred. No cheating!
If you get stuck, leave me a comment.
Trailhead Baby is always happy to help!
hi
ReplyDeletei assigned field sales profile then also getting error like Challenge Not yet complete... here's what's wrong:
Could not find a user named Samantha Cordero with the Field Sales User profile
Hi! This may be a silly question, but did you double check the spelling of the user's name? Also, did you clone the "standard" profile to create the custom profile? If you are sure that the user has been created and that she is assigned the correct profile, I would login to Salesforce1 as Samantha and create an opportunity.
ReplyDeleteThis comment has been removed by the author.
DeleteDid you assign Samantha the correct role, and login to Salesforce1 as Samantha?
DeleteI doubt that either of these are the issue though. The error message seems to indicate that the checker is not finding the user at all within the Org. If you would like to post a screen shot of Samantha's user profile, I am happy to take a look. Unfortunately, you might need to start over in a fresh Playground. I would start by doing the pre-work such as creating the user, before starting any of the challenge steps.
Hi, Trailhead Baby,
DeleteI love your blog. It's superhelpful. I'm tackling the Security Specialist superbadge and I've got a question about your hints in challenge #2. What is salesforce1? Thanks!
Salesforce1 = an older name for Salesforce mobile.
DeleteEssentially - login via your phone.
Makes sense?
Yes, thank you so much, Trailhead Baby!
Deletewhat happens if you didn't clone the standard user to create the profile?
DeleteWhat happens did you didnt clone standard user as a profile when creating the Field Sales User profile?
DeleteThen you have to start over by cloning the correct profile.
Deletei did all the steps correctly but still getting error like - We can't save this record because the “Opportunity Management” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: REQUIRED_FIELD_MISSING: Required fields are missing: [AccountId]. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 149889500-31883 (-1839703817
Deletethis error get during saving opportunity record.. i am struggling to this error...plz help me
DeleteWhat are you trying to do? It looks like you may be trying to create an opportunity without the required related account?
DeleteHi Baby,
ReplyDeleteI'm trying to run the Apex Test but while I have installed the Security Superbadge package, I am unable to select the BeAwesome test. I can find Beawesome in the Apex Classes, but when trying to select a test it shows no tests.
Is running the test critical to pass step 2?
Thanks, Tim
Great question! I do not know if you "have" to run the tests in order to pass. I did run them.
DeleteDid you navigate to "Apex Test Execution" within setup? If you do not see the tests, you may need to click compile all classes on the apex classes page... reference:
https://help.salesforce.com/articleView?id=code_test_execution.htm&type=5
I'm having a similar issue, although I can run the test I get "Class is not defined as global". Any idea what is going here?
DeleteThanks
Dean
Hi Dean,
DeleteThe class not being defined as global shouldn't impact the challenge.
Did the tests both pass?
I've been racking my brain on this one... Did you figure it out? I remember seeing this "class not defined as global" error one other time, but I can't remember what caused it. Are you still stuck? I'd like help you if you are still there. If you would email me some screenshots I'll take a look- rebecca@capstorm.com
DeleteHaving the same issue as Tim. I did click to compile all classes in Apex but still can't see the BeAwesome test.
DeleteHi Andy-
DeleteIs the problem not seeing the BeAwesome test:
Have you installed the package to your org? The package includes the Apex test that you need. If the package is installed- go to "Apex Test Execution" then select the test.
Having the class not defined as global should not be an issue- I passed the challenge without tweaking the code add this.
Is this the correct issue?
I'm also having the same issue. I've downloaded the package and can see the Apex class in 'Installed packages' but when I go to run the test, it isn't there.
DeleteThe only two tests appearing are 'playground installer' and 'welcome finder'.
That's an new one to me! I've done this superbadge twice and not encountered this error. Was the package installed for "all user" or just for the admin? That's the only thing that I can think of... :(
DeleteI have the same issue. I guess the problem is it´s installed in the org but not shown on the Playground.
DeleteLooking into this one.... under test classes are you changing the menu to [All Namespaces]?
DeleteHad same issue - the resolution is to minimize your screen size ("cntr"+"-") up to 75% and restart refresh your page.
Delete@unknown you just saved my life. I was about to go insane. Thank you so much!
DeleteI've managed to pass both tests 2/2 but
ReplyDeleteChallenge Not yet complete... here's what's wrong:
The sharing rule that shares Opportunities owned by Field Sales users with Inside Sales users does not appear to be setup correctly.
keeps popping up my rules must be correct any ideas on why this is popping up?
I'd start by making sure that rolls are set up correctly.
DeleteIf you would like to share some details regarding your sharing rule for opportunities, I'm happy to take a look at it.
There has to be a sharing rule for Opportunity object that shares records for all roles and subordinates from Inside Sales with Field Sales. That should be Read/Write.
DeleteOwner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write
I am getting exception when I ran BeAwesomw test. I have tried all the mentioned steps
ReplyDeleteI am getting system.dml exception
insert failed. Cannot_Insert_update_Activate_Entity xecm. UserSynchronizationTrigger
create user:line 147
I don't know exactly what would cause this exception. Recommend- reading the instructions for the challenge and double checking to make sure that all steps have been completed. Roles, User, Permission Set, Sharing Rule....
DeleteI keep getting "The sharing rule that shares Opportunities owned by Field Sales users with Inside Sales users does not appear to be setup correctly." even though I have inserted two Opportunity Sharing Rules :(
ReplyDeleteWould you be able to share some details of the sharing rules that you created?
Delete(The criteria would be helpful!)
Hi there,
DeleteFor Sharing rules these are my steps:
Setup - Sharing Settings - Opportunity Sharing Rule
> Label: Rule 1
> Criteria:
- Type equals Existing Customer - Upgrade
- Stage equals Closed Won
>Share with Group: Project Managers
>Opportunity Access: Read Only
> Label: Rule 2
- Opportunity: owned by members of - Role and Subordinates: Sales Executive
- Share with - Role: Inside_Sales
> Opportunity Access: Read/Write
Thank you so much
(PS Your baby looks really cute!)
The good news- I replicated the issue by restarting the superbadge in a new org.
DeleteThe bad news- I don't know why the error is showing yet! I'll let you know what I find out!
(Thanks for the comment on my little guy!) :)
Alright! I think I have an answer for you. It's a bit silly, but the order in which the steps are completed seem to really matter for this particular challenge.
Delete1) Create the 2 sharing rules for Opps
- Project Managers (read only with criteria)
- Sales Executives to Inside Sales (read/write)
What you h ave is perfect.
2) Do the Apex tests
3) Create the opportunities under your name
4) Reassign the opps to Samantha Cordero
Things have to be done in this specific order... Why? No idea!
Thank you so much Trailhead baby, I had everything done correctly, just wrong order. Step 2 now passed!! :-)
DeleteHi Trailhead baby,
DeleteI have done everything you said but still getting this error.
Challenge Not yet complete... here's what's wrong:
The sharing rule that shares Opportunities owned by Field Sales users with Inside Sales users does not appear to be setup correctly.
My brain is freezing trying to do this test since few weeks :(
Thanks
Hi Trailhead baby,
ReplyDeleteI have the same issue as the person mentioned above, i followed the steps in which you asked to try, but still I get the same error message
"Challenge Not yet complete... here's what's wrong:
The sharing rule that shares Opportunities owned by Field Sales users with Inside Sales users does not appear to be setup correctly."
Sharing Rule 1
(Opportunity: TypeEQUALSExisting Customer - Upgrade) AND (Opportunity: StageEQUALSClosed Won)
Group: Project Managers Read Only
Sharing Rule 2
Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write
Any help is highly appreciated. Thanks in advance.
P.S: I even tried with a new Trialhead Playground following all the steps from scratch but still the same issue persists.
The two sharing rules look perfect!
DeleteI have two additional sharing rules related to accounts.
This error message seems (from my own experience and digging around in the dev community) to occur when the superbadge is not completed in the "correct order." I found the order to be a bit vague in the instructions.
Once the sharing rules are created (add 2 for accounts)- hint:
1- Shares with Inside Sales role
2- Shares with Field Sales role
- run the apex tests
- create the opportunities
- reassign the opportunities to Samantha Cordero
If you are still stuck after this, just let me know!
Thanks for the reply Trailhead Baby,
DeleteI created a sharing rule as below for the account
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Inside Sales
Account and Contract - Read/Write
Opportunity - Private
Case - Private
But still I get the same error, I'm not sure what is the other sharing rule that should be added for accounts, Could you please guide me with what step I should take further.
I have another silly question, should we create 2 opportunities ? I have created one and assigned it to Samantha (as below)
Requirement - Create an opportunity owned by Samantha with the stage name 'Needs Analysis'. Create a Closed Won opportunity owned by Samantha, with the type of 'Existing Customer - Upgrade'.
Opportunity Details:
Opportunity Owner - Samantha Cordero
Opportunity Name - Needs Analysis
Close Date - 8/12/2019
Type - Existing Customer - Upgrade
Stage - Closed Won
Probability (%) - 100%
If I had to create the second one please hint me on that.
Thanks,
Logan
Hi Trailhead baby,
DeleteIgnore my earlier reply. I misread the requirements for creating 2 opportunities. I created 2 opportunities according to the requirement and added a sharing rule on Accounts. I cleared the second step. Thank you very much :)
Thanks,
Logan
Congrats! The good news- This step seems to be the most difficult part of the challenge! Hopefully you will get the superbadge soon!
DeleteThanks Trailhead baby, I got my superbadge :D thanks for your help
DeleteCheers,
Logan
Wooohoo! Way to go Logan!
DeleteAfter all, I created properly I m still getting errors in APEX test execution. Let me just reiterate what I did so far. Please correct me where I went wrong
Delete1. Created 3 profiles and edited needed settings -- field sales, inside sales, and sales executive.
2. Created 3 respective roles
3. Created user Samantha and assigned to Field user profile and Field user role
4. Installed package
5. OWD -- Account - Read/write;Opportunity - Private;Case-Private
6. Created Permission set: Project Manager
object -- Account : visible and available
Opportunity : visible and available and object permission : View All
7.Created Public group : Project Manager and assigned Samantha
8.Set sharing rule with criteria for type and stage and assign to public group with read only permission in opportunity
10.Set sharing rule that shares opportunity owned by roles and subordinates of sales executive user with roles of the inside sales user with read/write permission
11.Set sharing rule that shares account owned by roles and subordinates of sales executive user with roles of the inside sales user with read/write permission
12.Set sharing rule that shares account owned by roles and subordinates of sales executive user with roles of the field sales user with read/write permission
13.Run Apex test execution and it fails
Hey Trailhead Baby,
ReplyDeleteI have followed all the steps but still my test case "Beawesome" is not passing and I cant figure out the reason.
Let's talk about the details... Could you share details of your sharing rules? Role setup?
DeleteI have the same issue, Class is not defined as global. Any ideas?
DeleteThe Apex Class for this superbadge is not defined as global. This message should not impact passing the two tests. Where are you seeing this error message? Is it from the Trailhead challenge checker? On the Apex Test Executiion window, you should see the test methods passed, but I had to go into the Class Summary to get this message - not something you need to do for the superbadge.
DeleteThis challenge step will not pass unless you do the following in exact order:
1) Create the 2 sharing rules for Opps
2) Do the Apex tests
3) Create the opportunities under your name
4) Reassign the opps to Samantha Cordero
See: https://trailheadbaby.blogspot.com/2018/08/security-specialist-superbadge-1.html
The message about the class being global is misleading. The real cause of the problem is that the Apex Test is failing because one of your sharing rules is not set up/ not set up correctly. Drill down on the error on the test to see a more meaningful error message.
Delete(Opportunity: TypeEQUALSExisting Customer - Upgrade) AND (Opportunity: StageEQUALSClosed Won) Group: Project Managers Read Only
ReplyDeleteOwner in Role and Subordinates: Sales Executives Role: Inside Sales users Read/Write
Do you have the sharing rules set up for accounts?
DeleteHi,
ReplyDeleteI dont see anything under the apex test execution and thats why i cant run the apex test. Could you please help ?
Did you search for the tests? Check the instructions - You have to look for the "BeAwesome" test. Was the managed package installed?
DeleteHi ,
ReplyDeleteI am getting this error after I run the apex test execution. Please help .
Error : public class BeAwesome
Class is not defined as global
The Apex Class for this superbadge is not defined as global. This message should not impact passing the two tests. Where are you seeing this error message? Is it from the Trailhead challenge checker? On the Apex Test Executiion window, you should see the test methods passed, but I had to go into the Class Summary to get this message - not something you need to do for the superbadge.
ReplyDeleteHi Trailhead baby,
ReplyDeleteI created Sharing rules as mentioned below, but still getting this error -"Assertion Failed: Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user. #sadtrombone"
Setup - Sharing Settings - Opportunity Sharing Rule
> Label: Project Managers
> Criteria:
- Type equals Existing Customer - Upgrade
- Stage equals Closed Won
>Share with Group: Project Managers
>Opportunity Access: Read Only
> Label: Project Managers2
- Opportunity: owned by members of - Role and Subordinates: Sales Executive
- Share with - Role: Inside_Sales
> Opportunity Access: Read/Write
Setup - Sharing Settings - Account Sharing Rule
Label : Project Managers3
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Inside Sales
Account and Contract - Read/Write
Opportunity - Private
Case - Private
Label : Project Managers4
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Field Sales
Account and Contract - Read/Write
Opportunity - Private
Case - Private
I executed the sb_security:BeAwesome in Apex Test Execution and saw the error in Apex Test Result.
Thanks in advance
Double check "Project Managers3." A little tweak is needed with opportunity sharing.
DeleteFirstly appreciated for your response.
DeleteI tried many ways from morning for the whole day & still it is going on.
Can you please help me clear this stage, not getting what is wrong.
Tried following the whole comment section above but not able to clear.
Take a bow i clear it. Below are the steps. Part of the credit goes to a guy called @themaxworld in SF developer community.
ReplyDeleteA big credit for you as well trailhead baby. Thanks again.
1. OWD settings for Opportunity object is 'Private'
2. Created public group as 'Project Managers' for Project Manager related requirements.
3. Setup Profiles and Roles for Field Sales User, Inside Sales User, and Sales Executive User
4. Created 2 criteria based sharing rules for Opportunity:
> Label: Project Managers
> Criteria:
- Type equals Existing Customer - Upgrade
- Stage equals Closed Won
>Share with Group: Project Managers
>Opportunity Access: Read Only
> Label: Project Managers2
- Opportunity: owned by members of - Role and Subordinates: Sales Executive
- Share with - Role: Inside_Sales
> Opportunity Access: Read/Write
Setup - Sharing Settings - Account Sharing Rule
Label : Project Managers3
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Inside Sales
Account and Contract - Read/Write
Opportunity - Private
Case - Private
Label : Project Managers4
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Field Sales
Account and Contract - Read/Write
Opportunity - Private
Case - Private
With these steps i was able to clear the second step of security specialist superbadge.
Hi,
DeleteI have tried everything but still not passing the test. My apex test is passed but still getting the error :(
Challenge Not yet complete... here's what's wrong:
The sharing rule that shares Opportunities owned by Field Sales users with Inside Sales users does not appear to be setup correctly.
What do you have in your sharing rule?
DeleteAccount Sharing Rules
DeleteOwner in Role and Subordinates: Sales Executive Role: Field Sales Read/Write Private Private
Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write Private Private
Opportunity Sharing Rules
(Opportunity: TypeEQUALSExisting Customer - Upgrade) AND (Opportunity: StageEQUALSClosed Won)
Group: Project Manager Read Only
Owner in Role: Field Sales Role: Inside Sales Read/Write
Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read Only
Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write Private Private ----> Account sharing rule. This one is not correct.
DeleteOwner in Role: Field Sales Role: Inside Sales Read/Write
Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read Only
----> Opp sharing rules. There should be 2 total. You have 1 correct with the project managers. The one sharing with Inside Sales is not there yet.
I have tried different setting it's not working :(
DeleteOwner in Role and Subordinates: Sales Executive Role: Field Sales Read/Write Private Private
DeleteEdit | Del Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write Read/Write Private
(Opportunity: TypeEQUALSExisting Customer - Upgrade) AND (Opportunity: StageEQUALSClosed Won)
Group: Project Manager Read Only
Edit | Del Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write
still same error :(
This looks good. Check your OWD.
DeleteThis challenge step will not pass unless you do the following in exact order:
1) Create the 2 sharing rules for Opps
2) Do the Apex tests
3) Create the opportunities under your name
4) Reassign the opps to Samantha Cordero
hello Trailhead baby
DeleteThanks a lot for reply and guiding me. I have done all these steps again but still same error :(.
Did you check the OWD? I'd start from the top and make sure all of the security settings are correct..
DeleteOrganization-Wide Defaults
DeleteLead Public Read/Write/Transfer Public Read/Write/Transfer Checked
Account and Contract Public Read/Write Public Read/Write Checked
Opportunity Private Private
Account:
Owner in Role and Subordinates: Sales Executive Role: Field Sales Read/Write Private Private
Owner in Role and Subordinates: Sales Executive Role: Inside Sales User Read/Write Read/Write Private
Opportunity Sharing Rules
(Opportunity: StageEQUALSClosed Won) AND (Opportunity: TypeEQUALSExisting Customer - Upgrade)
Group: Project Managers Read Only
Owner in Role and Subordinates: Sales Executive Role: Inside Sales User Read/Write
Profile Setting:
DeleteField Sales User:
Account : read and edit
Opportunities: Read,Create & Edit
Inside Sales User:
Account : Read, Create, Edit
Opportunities: Read, Create, Edit
Sales Executive:
Account : Read, View All
Opportunities: Read, View All
Public Group : Project Manager
Roles :
Sales Executive
Field Sales
Inside Sales User
Anything I am missing ??
DeleteDo I have to make any permission set for Field sales user?
Please help me I am going crazy :(
Check the OWD for account...
DeleteSharing rules are perfect!
Profiles are perfect!
No permissions sets needed.
Hi There!
ReplyDeleteI passed the 2 tests through Apex but continue to get error message:
Challenge Not yet complete... here's what's wrong:
Could not find a user named Samantha Cordero with the Field Sales User profile.
I have tried everything. Logged in as Samantha and set up opps. Nothing has worked.
It shows successful login history. Any suggestions?
Hello! I have not encounter that error before.... I'm sure this is a silly question-- Have you double checked the profile for Samantha Codero? Is she assigned to both the role and the profile? Is the field sales user profile cloned from the "standard profile"?
DeleteHi,
DeleteI am facing the same issue. As mentioned by you, I have cloned the Standard User profile assigned the same role. My apex coded ran successfully. Now I'm getting the error - Could not find a user named Samantha Cordero with the Field Sales User profile.
Did you create the "Samatha Cordero" user a few times? I'd give it 24 hours then recheck.
DeleteDo you really *have* to log in as Samantha to create the two opportunities vs. just creating them (from any account) and then assigning ownership to Samantha?
ReplyDeleteYes, I believe that you do. A user also has to login via mobile in order to set up mobile settings...so I would just login at Samantha via mobile to knock out both items at one time.
DeleteCould I be wrong? Absolutely. This is the way that I did it though both times that I completed this superbadge. Good luck!
Hi, When i run the test it fails.
ReplyDeleteThese are the errors:
Time Started 5/11/2018 16:16
Class BeAwesome
Method Name helpAStranger
Pass/Fail Fail
Error Message System.QueryException: List has no rows for assignment to SObject
Stack Trace Class.sb_security.BeAwesome.createUser: line 133, column 1
Class.sb_security.BeAwesome.setup: line 124, column 1
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7
Time Started 5/11/2018 16:16
Class BeAwesome
Method Name hugYourMother
Pass/Fail Fail
Error Message System.QueryException: List has no rows for assignment to SObject
Stack Trace Class.sb_security.BeAwesome.createUser: line 133, column 1
Class.sb_security.BeAwesome.setup: line 124, column 1
///////////////////////////////////////////////////////////////////////////////////
Previous Config:
1. OWD settings for Opportunity object is 'Private'
2. Created public group as 'Project Managers' for Project Manager related requirements.
3. Setup Profiles and Roles for Field Sales User, Inside Sales User, and Sales Executive User
4. Created 2 criteria based sharing rules for Opportunity:
> Label: Project Managers
> Criteria:
- Type equals Existing Customer - Upgrade
- Stage equals Closed Won
>Share with Group: Project Managers
>Opportunity Access: Read Only
> Label: Project Managers2
- Opportunity: owned by members of - Role and Subordinates: Sales Executive
- Share with - Role: Inside_Sales
> Opportunity Access: Read/Write
Setup - Sharing Settings - Account Sharing Rule
Label : Project Managers3
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Inside Sales
Account and Contract - Read/Write
Opportunity - Private
Case - Private
Label : Project Managers4
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Field Sales
Account and Contract - Read/Write
Opportunity - Private
Case - Private
The Account sharing rule, sharing accounts with Inside Sales role- "read/write" on opportunity is not correct.
DeleteHello all,
DeleteWonder if this thread is still active, I came across it when looking to solve an issue i faced in the 2nd step of the "Security Specialist" Superbadge and found that other people faced the same issue but didn't find the answer here.
Fortunately i managed to find the problem after trying for several days, and i am sharing it with you guys to save you some time, so for people who couldn't pass the tests because of the following error :
Challenge Not yet complete... here's what's wrong:
The unit tests in the managed package have not passed successfully. Make sure you run all test in your org before checking this section. Ensure that they all pass.
And on the developer console the error message :
System.QueryException: List has no rows for assignment to SObject
The error message is not precise and the fail message on the challenge is not pointing towards the problem as well.
And the problem for me was that i had the name of a profile wrong, or at least not as expected by the assertEquals method, i had a profile named "Sales Executive User" instead of "Sale Executive User". And that's why the query was returning no rows in the test and hence the exception.
Not easy to spot, especially since you don't expect a problem for roles and profiles after you pass the first step, but very easy to solve, so for those of you facing the same exception, verify the names of your roles, profiles, users ... and make sure they match the ones in the challenge.
Good luck for you all.
Cool! Thank you!
Deletehiii baby i'm having apex test error for last 2 months can you help me?
DeleteCould you share some details?
DeleteEverything is done. Still cannot pass it. :(
DeleteI will tell the steps that I have done.
1) Installed package
2) Created 3 profiles
3) Created Roles
4) Created User Samantha Cordero and assigned proper role and profile.
5) Created Public group "Project manager"
6) Made OWD private for Opportunites
7) Created 2 Opportunity Sharing Rules and 2 Account Sharing rules
---Account Sharing Rules---
Criteria : Owner in Role and Subordinates: Sales Executive User
Shared With Role: Field Sales User
Account and Contract : Read/Write
Contact : Private
Opportunity : Private
Case : Private
Criteria - Owner in Role and Subordinates: Sales Executive User
Share with - Role: Inside Sales User
Account and Contract - Read/Write
Opportunity - Private
Case - Private
Contact - Private
---Opportunity sharing rules---
1)
> Criteria:
- Type equals Existing Customer - Upgrade
- Stage equals Closed Won
>Share with Group: Project Managers
>Opportunity Access: Read Only
2)
Opportunity: owned by members of - Role and Subordinates: Sales Executive
- Share with - Role: Inside_Sales
> Opportunity Access: Read/Write
Apex test Execution
Cannot find BeAwesome class in [All NameSpaces]
Kindly help me
Everything is done. Still cannot pass it. :(
DeleteI will tell the steps that I have done.
1) Installed package
2) Created 3 profiles
3) Created Roles
4) Created User Samantha Cordero and assigned proper role and profile.
5) Created Public group "Project manager"
6) Made OWD private for Opportunites
7) Created 2 Opportunity Sharing Rules and 2 Account Sharing rules
---Account Sharing Rules---
Criteria : Owner in Role and Subordinates: Sales Executive User
Shared With Role: Field Sales User
Account and Contract : Read/Write
Contact : Private
Opportunity : Private
Case : Private
Criteria - Owner in Role and Subordinates: Sales Executive User
Share with - Role: Inside Sales User
Account and Contract - Read/Write
Opportunity - Private
Case - Private
Contact - Private
---Opportunity sharing rules---
1)
> Criteria:
- Type equals Existing Customer - Upgrade
- Stage equals Closed Won
>Share with Group: Project Managers
>Opportunity Access: Read Only
2)
Opportunity: owned by members of - Role and Subordinates: Sales Executive
- Share with - Role: Inside_Sales
> Opportunity Access: Read/Write
Apex test Execution
Cannot find BeAwesome class in [All NameSpaces]
One of the sharing rules is incorrect.
DeleteHi, i change: The Account sharing rule, sharing accounts with Inside Sales role- "read/write" with "Read Only" and it doesn`t work.
ReplyDelete"Read Only" for the sharing rule that shares accounts with inside sales is not correct.
DeleteDouble check the instructions to see what permissions the inside sales role should have for opportunities.
Hi, the test doesn work:
Delete1. OWD settings for Opportunity object is 'Private'
2. Created public group as 'Project Managers' for Project Manager related requirements.
3. Setup Profiles and Roles for Field Sales User, Inside Sales User, and Sales Executive User
4. Created 2 criteria based sharing rules for Opportunity:
> Label: Project Managers
> Criteria:
- Type equals Existing Customer - Upgrade
- Stage equals Closed Won
>Share with Group: Project Managers
>Opportunity Access: Read Only
> Label: Project Managers2
- Opportunity: owned by members of - Role and Subordinates: Sales Executive
- Share with - Role: Inside_Sales
> Opportunity Access: Read/Write
5. Created 2 criteria based sharing rules for Account:
Setup - Sharing Settings - Account Sharing Rule
Label : Project Managers3
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Inside Sales
Account and Contract - Read/Write
Opportunity - Read/Write
Case - Private
Label : Project Managers4
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Field Sales
Account and Contract - Read/Write
Opportunity - Private
Case - Private
I don't see any issues with this-- Are you still getting the same message with the apex tests?
DeleteThis post might be helpful:
https://trailheadbaby.blogspot.com/2018/08/security-specialist-superbadge-1.html
Yes, i steel have the same errors, and i do it all again in a new Develop Console.
DeleteWould you mind emailing me a few screenshots? I'd like to take a look at what you have.
DeleteI've seen this error message before, but I can not remember what triggers it.
No problem, I dont´t know your email, can you write me to my email zerfascristian@gmail.com with the screenshots that you need.
ReplyDeleterebecca@capstorm.com and send me anything you think is applicable. I won't give a "click here" answer, but I'll try to point you in the correct direction.
DeleteThanks Rebecca, i just passed the Step 2 and 3. I have a problem with the step 4, i can´t find the "Customer SSN and Bank Account" fields on contact records. I´ve Installed the Trailhead Security superbadge managed package.
DeletePerhaps because those fields do not exist- and you can't encrypt a field that doesn't exist.
Delete(And - HINT! - you shouldn't have to create any fields to pass the challenge.)
Thanks i got it.
DeleteHi, I received a message "Challenge Not yet complete... here's what's wrong:
ReplyDeleteCould not find a user named Samantha Cordero with the Field Sales User profile." and this persists almost a day... I DID created "Samantha Cordero" and assigned profile "Field Sales User" and role "Field Sales" (I checked the spelling of these again and again), and login by user Samantha Cordero from Salesforce Mobile(iPhone) and there was no problem logging in and view opportunities. Why does this message keep showing? I have read through all the previous comments but no way I could find.
Someone please help me out!
Did you asign her Field User Role ?
DeleteWas the "Field Sales User" profile created by cloning the Standard Profile?
DeleteI'm happy to take a look at what you have- if you would email a few screenshots to rebecca@capstorm.com
Hi Rebecca (Trailhead baby),
ReplyDeleteI am having the same issue as Cristian had, I have used the same exact set of instructions mentioned by him, but my apex tests keep failing, I shall also send you screen shots of the same please help me , thanks in advance!
Hello! Check the org wide defaults for the account object - if this doesn't solve the issue, I can look a little deeper.
DeleteThank you for the quick response Rebecca, in OWD for the "Account and Contract" object I tried all the possible options (Private and Public Read Only) but the same result 'Apex Test Execution' fails both the tests. Please see the screen shots that I have sent you to your mail ID ... Thanks again
ReplyDeleteGiri- Your OWD settings for accounts are not correct in the screenshots that you sent. I also see an issue with a profile.
DeleteBeating my head against the wall. I tried everything I could think of. I keep getting "The sharing rule that shares 'Closed Won' Opportunities with Project Management users does not appear to be setup correctly." I have created the opportunities owned by Samantha as stated. I have created sharing rules for PM role. I do have sharing rules for Account. Still the same error. I double checked the user name for Samantha. I can't think of anything else to check.
ReplyDeleteOWD settings have Opps set to Private and Account set to Public Read Only.
Account Sharing Rules
Criteria Shared With Account and Contract Opportunity
Owner in All Internal Users Role: Field Sales User Read/Write Private
Owner in All Internal Users Role: Inside Sales User Read/Write Read/Write
Opportunity Sharing Rules
Criteria:
(Opportunity: TypeEQUALSExisting Customer - Upgrade) AND (Opportunity: StageEQUALSClosed Won)
Shared With: Role: Project Manager User ReadOnly
Criteria: Owner in All Internal Users Shared With: Role: Sales Executive User Read Only
Criteria: Owner in All Internal Users Shared With: Role and Subordinates: Inside Sales User Read/Write
Would greatly appreciate any suggestions
Here's a little tip - Project Manager should not be a roll since a person can not have 2 rolls.
DeleteTip #2: There are 2 sharing rules on opportunity.
Once you get the Project Manager bit sorted out, feel free to leave a comment with your revised setup, and I'll take a deeper look.
Thank you for following up on each one of these comments. I have been stuck for hours and found the answers here. I created my opportunities before I created my Opportunity Sharing Rule. Not sure what is happening under the covers in Salesforce, but the opportunities I created before the sharing rule, were not being shared.
ReplyDeleteHello all,
ReplyDeleteI also face the problem with Apex failing 2 times
Error Message System.QueryException: List has no rows for assignment to SObject
Stack Trace Class.sb_security.BeAwesome.createUser: line 132, column 1
Class.sb_security.BeAwesome.setup: line 127, column 1
I named
roles: Sales Executive, Field Sales, Inside Sales
profiles: Field Sales User, Inside Sales User, Sales Executive User
I am pretty sure the configuration is in line with what is recommended above
Do you have the sharing rules plus public group?
Deletei am facing the same issue both of my apex tests are failing with the same above error and my configuration also matches with above user
DeleteHi Trailhead Baby
ReplyDeleteI'm stuck on this one too. I have spent HOURS on it. I keep getting failing Apex with error: Error Message System.QueryException: List has no rows for assignment to SObject.
I have OWD for Account & Contract to Public Read/Write and checked is Grant Access Using Heirarchies
I have OWD for Opps to Private and checked is grant access using heirarchies
I have 3 profiles - one for Sales Executive User, one for Inside Sales User, and one for Field Sales Uesr. I have roles for those three as well. I have a Public Group for Project Managers.
I have three sharing rules.
Account
criteria owner in role and subordinates: sales executive user shared with role: inside sales user. read/write, private private.
Opp
(opportunity: type equals existing customer-upgrade) and (opp: stage equals closed won) shared with group: project managers, read only
opp
owner in role and subordinates: sales exec user shared with role: inside sales user, read/write
I then ran the tests, failed, but created the opps, reassigned to user: Samantha Cordero. She is assigned as field sales user role and profile. I created the others and assigned them appropriately as well.
I'm stumped!
Two hints:
Delete* OWD for Account's should not be "public read/write"
* You will need 2 account sharing rules
Ok. I changed OWD for accounts to be public read only.
ReplyDeleteThen I added another account sharing rule so now they are as follows - and I'm still failing. :-(
Owner in Role and Subordinates: Sales Executive User Role: Inside Sales User Read/Write Read/Write Private
Owner in Role and Subordinates: Sales Executive User Role: Field Sales User Read/Write Private Private
hmmmm I do not see any issues. goodness. Are you still getting the same error message with the unit tests?
DeleteHi Trailhead Baby - I finally passed! It was the names of my roles. I had Sales Executive User, not Sales Executive, for instance.
DeleteThank you for all of the help!!!! You're a life saver!
Horray! Glad you passed!!!
DeleteChallenge Not yet complete... here's what's wrong:
ReplyDeleteThe sharing rule that shares Opportunities owned by Field Sales users with Inside Sales users does not appear to be setup correctly.
Getting this error on Step 2 can't figure it out to save my life - anyone willing to assist :)
Could you share what you have?
DeleteSure thing,
DeleteI've set up the 3 profiles.
I've set up Sam as the only user so far.
OWD for Ops is Private
Apex Test's are passing
My Roles Have Sales Exec Under CEO and then the other two underneath that
Rule 1 on Ops: (Opportunity: TypeEQUALSExisting Customer - Upgrade) AND (Opportunity: StageEQUALSClosed Won)
Shared with: Group: Project Manager
Opportunity: Read Only
Rule 2 on Ops: Owner in Role and Subordinates: Sales Executive Shared With: Inside Sales Op: Read/Write
I am using a public group for Project Manager.
Does there seem to be anything Im missing?
thank you for responding so fast initially, had not expected :)
Looks good- but there are 2 more sharing rules to create on another object. I'd bet you will pass after these are created!
DeleteHi! For some reason, when I try to add a user to the Field User profile, no users show up...any ideas??
ReplyDeleteThere is the option to add new Users, but none o my previous users show up...including Samantha.
Are you on the user detail page to add the user to the profile? I'd check the user license....
DeleteIt should be "Salesforce." If you picked "Salesforce Platform User"- the profile will not be available.
Hi Trailhead baby,
ReplyDeleteI have been working on this step 2 for 4 days.. i got stucked with the error "Challenge Not yet complete... here's what's wrong:
The sharing rule that shares Opportunities owned by Field Sales users with Inside Sales users does not appear to be setup correctly." ... and i have checked dev console its shwing the error "EXCEPTION_THROWN [13]|System.AssertException: Assertion Failed: Expected: 1, Actual: 0" ..
please help me..and i have tried all the ways
Please leave a comment with what you currently have, and I will take a look.
DeleteHi team,
ReplyDeleteI am on Security superbadge trailhead. I am getting List has no rows for assignment while performing run all tests.
Class name : sb_security.BeAwesome
Badge error: Challenge Not yet complete... here's what's wrong:
The sharing rule that shares Opportunities owned by Field Sales users with Inside Sales users does not appear to be setup correctly.
Please help me to resolve.
Thanks,
Hi - Unfortunately I'm not a team. Just a solo blogger :) How is your sharing rule set up currently?
DeleteHi, I am also struck on the challenge 2 in superbadge:
ReplyDeleteObject Default Internal Access Default External Access Grant Access Using Hierarchies
Account and Contract Public Read Only Public Read Only Checked
Account sharing rules :
Edit | Del Owner in Role and Subordinates: Sales Executive Role: Field Sales Read/Write Private Private
Edit | Del Owner in Role and Subordinates: Sales Executive Role: Inside Sales User Read/Write Read/Write Private
Oppty sharing rules :
Object Default Internal Access Default External Access Grant Access Using Hierarchies
Opportunity Private Private Checked
Edit | Del
(Opportunity: Type EQUALS Existing Customer - Upgrade) AND (Opportunity: Stage EQUALS Closed Won)
Group: Project Managers Read Only
Edit | Del Owner in Role and Subordinates: Sales Executive Role: Inside Sales User Read/Write
can u pl;ease help. I am unable to pass this.
The positive is that what you have is perfect.... What error message are you receiving?
DeleteI posted about this superbadge twice, so you may also want to reference the newer post. My guess is that you did not do these steps in the exact order:
1) Sharing Rules
2) Apex Tests
3) Create Opportunities
4 Reassign Opportunities
Hi Trailhead Baby,
ReplyDeleteFor the above challenge two Please find the things I have completed.
I created User Samantha Cordero and assigned to Field sales profile.
Created New roles Sales execuitive, Inside sales and Field Sales , assigned Field sales to Samantha.
Logged in as Samantha and created opportunities.
Created two sharing rule
1. Criteria based Type = Existing customer-Upgrade && Stage == Closed Won assign to Role Project managers Group with Read only access
Created Project manager Group.
Rule 2
Based on Owner = Roles and Subordinate = Sales execuitive
Assign to
Role = Inside sales
Read Write permission.
When i Run test Apex test Execution it failed please see the error message :
0:00
sb_security.BeAwesome
helpAStranger
Fail
System.QueryException: List has no rows for assignment to SObject
Class.sb_security.BeAwesome.createUser: line 133, column 1
Class.sb_security.BeAwesome.setup: line 127, column 1
[View]
0:00
sb_security.BeAwesome
hugYourMother
Fail
System.QueryException: List has no rows for assignment to SObject
Class.sb_security.BeAwesome.createUser: line 133, column 1
Class.sb_security.BeAwesome.setup: line 127, column 1
Hi, the challenge throws following error.
ReplyDeleteSystem.QueryException: List has no rows for assignment to SObject
Class.sb_security.BeAwesome.createUser: line 133, column 1
Class.sb_security.BeAwesome.setup: line 127, column 1
[View]
0:00
sb_security.BeAwesome
hugYourMother
Fail
System.QueryException: List has no rows for assignment to SObject
Class.sb_security.BeAwesome.createUser: line 133, column 1
Class.sb_security.BeAwesome.setup: line 127, column 1:
1. OWD settings for Opportunity object is 'Private'
2. Created public group as 'Project Managers' for Project Manager related requirements.
3. Setup Profiles and Roles for Field Sales User, Inside Sales User, and Sales Executive User
4. Created 2 criteria based sharing rules for Opportunity:
> Label: Project Managers
> Criteria:
- Type equals Existing Customer - Upgrade
- Stage equals Closed Won
>Share with Group: Project Managers
>Opportunity Access: Read Only
> Label: Project Managers2
- Opportunity: owned by members of - Role and Subordinates: Sales Executive
- Share with - Role: Inside_Sales
> Opportunity Access: Read/Write
5. Created 2 criteria based sharing rules for Account:
Setup - Sharing Settings - Account Sharing Rule
Label : Project Managers3
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Inside Sales
Account and Contract - Read/Write
Opportunity - Read/Write
Case - Private
Label : Project Managers4
Criteria - Owner in Role and Subordinates: Sales Executive
Share with - Role: Field Sales
Account and Contract - Read/Write
Opportunity - Private
Case - Private
I created two records by logging in as samantha from salesforce mobile .
I cleared cokkies logged out and logged in to run the test still the same error Test execution is failing.
This is a sticky one - I just responded to your email. What you have looks good. What error message is being kicked back when you try to check the challenge?
DeleteChallenge Not yet complete... here's what's wrong:
ReplyDeleteWe couldn't find the Sharing Rule that shares Opportunities owned by Field Sales users with Inside Sales users. Please check if the setup of this Sharing Rule is correct.
Show this error anyone help
i dont know where i made mistake
Share details of your sharing rule, and I'd bet someone can help!
DeleteI'm not the OP but I'm encountering the same error.
DeleteIn my sharing rule, the criteria is "Owner in Role: Field Sales" and "Shared With" is "Role: Inside Sales".
I also have another similar rule where "Shared With" is "Role and Subordinates: Inside Sales".
Do help me know what's wrong with my rule(s). Thanks!
You should have 4 sharing rules total. None of them have Field Sales sharing with any other role.
DeleteI was successfully able to create the sharing settings / Samantha User and the Opportunities.
ReplyDeleteBut when I am trying to run the Apex Test, it gives an error -
Class.sb_security.BeAwesome.createUser: line 133, column 1.
Thats the reason when I am trying to check challenge it says -
Challenge Not yet complete... here's what's wrong:
The unit tests in the managed package have not passed successfully. Make sure you run all test in your org before checking this section. Ensure that they all pass.
Can you please help.?
Please share some details of what you have.
DeleteCould you help me about this mistake??
ReplyDeleteApex test: Error message: System.AssertException: Assertion Failed: Inside Sales users should be able to update Accounts owned by Fields Sales and Sales Executive users but the updates failed. #sadtrombone: Expected: 2, Actual: 1
I expect that there is an issue with the sharing rules. Would you like to share what you have?
DeleteHi, not sure if it has been said, I just wanted to say: you can change the owner of an opportunity once the opportunity is created. No need to log in as Samantha Cordero here. Just create and then change owner :)
ReplyDeleteI am getting unit test fail error
ReplyDeleteSystem.QueryException: List has no rows for assignment
i am also getting System.QueryException: List has no rows for assignment
ReplyDeleteDid you clone your custom profiles from the standard user profile?
DeleteHi
ReplyDeleteI have doubt while creating profiles. I created a Profiles under Salesforce licence. But I can assign it to only one user. So I tried to create a different licence for the profile, but each licence doesn't contain a opportunity object. So Can you tell me which Licence is used to create a profile and assign it to the user. Because of this apex test failed and can't pass this challenge.
Salesforce user license is correct. Are you using a Trailhead playground org?
DeleteHey, thank you for this blog. The developer and official forum posts seem to be taken down. But you can learn a lot from going through issues in a manner such as this, so I appreciate it.
ReplyDeleteI was stuck. I'm also still a little uncertain as to why it worked the way it did so hoping to clarify that with any who read this and can give feedback.
Reading the requirements on the Superbadge I read:
"Allow access to accounts to anyone in the org, regardless of who owns them, as long as their profile allows access to Accounts in general. Note: keep default options for contacts.
Note: These general record-level security requirements can be overridden by the more specific requirements set below."
Now I interpreted this as OWD Account - Public Read.
I therefore was puzzled when reading the account sharing rules. As the Opportunity sharing rules were the only ones that I felt were required. It didn't help that the error message I was receiving up until the point of me adding the account sharing rules and changing OWD to private was 'Cannot find the sharing rule that shared Field Sales opportunities with Inside Sales'.
Either way I finally managed to get this working.
Notes:
I created profiles from standard user.
I only changed Sales Executive profile details (view all). (as challenge 1 was complete when I started a new playground, so the profile details were not relevant for step 2 other than existing and view all for sales execs).
I ended up with x2 sharing rules for Account and x2 for Opportunity
I added the role hierarchy under CEO, you do not need a clean slate in the role hierarchy e.g. deleting all the roles that exist.
I didn't login with SF1.
Not to sound like a broken record, but I'm also getting the "Could not find a user named Samantha Cordero with the Field Sales User profile" error message. i've followed along with your other suggestions, and ones on other sites and can't seem to crack this!! Been trying for days and really am dreading starting all over.
ReplyDeleteHi if you have problem with " System.QueryException: List has no rows for assignment" on line 133 ... what I identify as usable solution
ReplyDelete1] the flow is really critical :) as is mention above on this page
2] there need to be created one more Sharing rule for opportunities
> Label: whatever you want ;)
- Opportunity: owned by members of - Role: Field Sales
- Share with - Role: Inside_Sales
> Opportunity Access: Read/Write
after I did this -> test works immediately on several playground
+ in case error is on line 132 ... than you have wrond name on profile :)
This worked!!!!! thank you
Deletehi @trailheadbaby
ReplyDeletei am having a problem passing the second apex test case...its been 2 days and i am not able to find any solution!
Error Message System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [SolarBot__c]: [SolarBot__c]
Stack Trace Class.sb_security.BeAwesome.hugYourMother: line 72, column 1
shows this message!
i would really appreciate if you could help me with this one!
Double check your sharing rules.
DeleteUnable to pass the apex test 1/2, getting below error msg. Tried everything, Please help!
ReplyDeleteError Message System.AssertException: Assertion Failed: Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user. #sadtrombone: Expected: 1, Actual: 3
Stack Trace Class.sb_security.BeAwesome.hugYourMother: line 91, column 1
Your sharing rules are probably incorrect.
DeleteI had tried everything but not able to clear apex test after changing multiple sharing rule.
DeleteSharing rule means you are talking abt Opportunity Sharing Rules.
There should be 4 sharing rules total. 2 on account, 2 on opportunity.
DeletePlease find the details and let which part needs to corrected, as not able to pass apex test 1/2 having same error:-
ReplyDelete1.Created a user Samantha Cordero assigned with role Field sales & Profile Field sales executive
2.Created 3 profile
1>Field Sales User - Accounts & Opportunities- RE & RCE 2>Inside Sales User - Accounts & Opportunities- RCE. 3> Sales Executive User - Accounts & Opportunities - RVA
3. Created Public Groups - Project Managers - Grant Access Using Hierarchies checked
4. Created roles Sales Executive - Field Sales - Inside Sales
5. OWD - Lead Public Read/Write/Transfer, Account and Contract Public Read Only
Opportunity Private.
6.Account Sharing Rules -
Owner in Role and Subordinates: Sales Executive Role: Field Sales Read/Write Private Private
Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write Read/Write Private
7. Opportunity Sharing Rules
(Opportunity: TypeequalsExisting Customer - Upgrade) and (Opportunity: StageequalsClosed Won)
Group: Project Managers Read Only
Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write
Few question - Whether to create sharing opportunity by login as user Samantha, where I don't option to create them. So created by admin account, is it correct?
And to run apex test do we have to login as Samantha to clear apex, as getting same error running on both user and admin.
with error msg: - Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user. #sadtrombone: Expected: 1, Actual: 3
Sharing rules look ok. You have to create an opportunity as Samantha by logging in as Samantha. Apex Tests run as your login (admin). I'd double check the roles.
DeleteYes opportunity will be created once apex test is passed first right? I'm having an issue with apex test with error mention above. Its been long now, don't know what I'm missing.
ReplyDeleteHi,
ReplyDeleteI am getting below Error while doing the challenge.
Challenge Not yet complete... here's what's wrong:
We couldn't find the Sharing Rule that shares Opportunities owned by Field Sales users with Inside Sales users. Please check if the setup of this Sharing Rule is correct.
I have tried all the possible solutions provided in the different forum, with different trainheads Please help me with this. I have been working on this from past 3 days still same thing.
I have done following steps as well.
1. Navigate to "Sharing Settings"
2. Edit "Organization-Wide Defaults" and set "Opportunity" to private in the drop-down menu and save.
3. Scroll down to "Opportunity Sharing Rules" and click "new"
Rule1.
1. Label can be anything you like
2. Rule type = "based on criteria"
3. Field = Type, Operator = Equals, Value = Existing Customer - Upgrade (the last one will be in the lookup using the icon right next to it)
- the second field will be: Field = Stage, Operator = Equals, Value = Closed Won (also use the lookup icon)
***Make sure you created a public group called "Project Managers" prior to this step if you haven't already***
4. "Share with" should be "Public Groups" in the first drop-down, and "Project Managers" for the second drop down.
5. Opportunity access should be set to "read-only"
Rule 2.
1. Label can be anything you like
2. Rule type = "Based on Record Owner"
3. Opportunity: owned by members of = Roles and Subordinates, and choose Sales Executives for the second drop-down menu
4. Share with: Roles, and choose Inside Sales Users for the second drop-down menu
5. Opportunity access should be set to "Read/Write"
Save both of these rules.
Type "Apex" into your quick search and choose Apex Test Execution
- Click Select Tests
- Choose "All namespaces" from the drop-down menu
- Choose "BeAwesome" and click run.
Your results should be 2/2.
Now navigate to the app launcher, and launch the "Sales" tab, and click on "Opportunities"
1. Click New
2. Name the opportunity anything you want
3. Choose Stage "Needs Analysis"
4. The close date should be picked as a value in the future.
5. click save
6. Create another "New" opportunity and name it anything you'd like again
7. For type, select "Existing Customer - Upgrade"
8. Set the date as whatever today's date is
9. Set the stage to "Closed Won"
10. Save
Now we need to make these opportunities owned by your user "Samantha Cordero"
1. Open the first opportunity you created, and click on the details tab
2. Under "Opportunity Owner" select "Change Owner" and change it to Samantha Cordero
3. Repeat steps 1-2 on the second opportunity.
I left a note on the 1st comment with this on the other blog post.
DeleteI just want to say there is a lot of information the correct way to do this. Sharing rules, profiles and obvious things aside this challenge needs to be done in the correct order. I've created 3 Playgrounds and did all the profiles, sharing rules etc the same way except I did it in various orders. If your issue isn't your Apex Test failing then you just did the wrong actions. If you're Apex Test is failing then possibly you did the correct actions but in the wrong order. Plenty of posted above the correct order.
ReplyDeleteKeep it up, This gives me very useful information. Thanks for sharing this with us. The Desperation in Sales “Make a Customer Not a Sale”
ReplyDeleteHi Trailhead Baby,
ReplyDeleteI've been trying to complete superbadge2 from 2 days but not able to clear it.
1- Created 3 profiles.
2- Created Roles.
3- Created user "Samantha Cordero" and assigned to appropriate role and profile.
4) Created Public group "Project manager"
5) Made OWD private for Opportunites
6) Created 2 Opportunity Sharing Rules
---Opportunity sharing rules---
1)Criteria: Rule 1
Type equals Existing Customer - Upgrade
Stage equals Closed Won
Share with Group: Project Managers
Opportunity Access: Read Only
Criteria: Rule 2
Opportunity: owned by members of - Role and Subordinates: Sales Executive
Share with - Role: Inside_Sales
Opportunity Access: Read/Write
7- Logged in to salesforce using Samantha user and created mentioned opportunity.
Problem 1- Ran apex test, but its failing.
Problem 2 - Clicked on challenge and the error says "We couldn't find the Sharing Rule that shares Opportunities owned by Field Sales users with Inside Sales users. Please check if the setup of this Sharing Rule is correct."
Please guide me through this and help me in finding the mistake I'm doing.
Do you have 4 sharing rules total? Or just 2? You should have 4.
DeleteHi Trailhead baby,
DeleteThanks much for your reply!! I cleared the superbadge challenge 2 test, yeyyyy!!!
I have created two "Opportunity" sharing rule.
I found the problem, it was with the "Role" I had created. "Field sales" role and "Inside sales" role wasn't reporting to "Sales executive" role. I recreated the roles as per the requirement and then again assigned to user "Samantha". Recreated the sharing rules and ran apex test, and got result as pass 2/2.
I am in challenge 2...Is it required to login as Samantha before creating the opportunity record and testing apex ??
ReplyDeleteNo.
DeleteIn apex Test one class error is like this:
Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user
Then there is an issue with the Profile or the Sharing Rule.
DeleteHi,
DeleteAm getting the same Error
My profile settings are:
Field sales users: Account=R/E,Opp=R/C/E
Inside Sales Users:Account=R/C/E,Opp=R/C/E
Sales Executive User:Account=R,View All,Opp=R/View All
And Sharing rules:
--Opportunity sharing rules---
1)Criteria: Rule 1
Type equals Existing Customer - Upgrade
Stage equals Closed Won
Share with Group: Project Managers
Opportunity Access: Read Only
Criteria: Rule 2
Opportunity: owned by members of - Role and Subordinates: Sales Executive
Share with - Role: Inside_Sales
Opportunity Access: Read/Write
Account Sharing Rules -
Owner in Role and Subordinates: Sales Executive Role: Field Sales Read/Write Private Private
Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write Read/Write Private
OWD - Account-Public Read Only
Opportunity Private.
After all this getting error as:
In apex Test one class error is like this:
Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user
Please help me,if anything is wrong
Thanks
What you have looks perfect. Are your rolls set up correctly?
DeleteYes I Guess
DeleteRoles: Sales Executive-Users in this role can edit all opportunities associated with accounts that they own, regardless of who owns the opportunities
Field Sales: Users in this role cannot access opportunities that they do not own that are associated with accounts that they do own
Inside Sales: Users in this role can edit all opportunities associated with accounts that they own, regardless of who owns the opportunities
And Do I need to create oppurtunity record and change the owner to samantha before or after apex test??
Deleteplease help me with this .
Thanks.
2 of the 3 on roles are incorrect
DeleteRoles: Sales Executive-Users in this role can edit all opportunities associated with accounts that they own, regardless of who owns the opportunities.
DeleteField Sales: Users in this role cannot access opportunities that they do not own that are associated with accounts that they do own.
Inside Sales: Users in this role cannot access opportunities that they do not own that are associated with accounts that they do own
Are these conditions correct??because i tried all the three options on every role but still getting the same error
In apex Test one class error is like this:
Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user
Please help me
Thanks
3 out of 3 are incorrect. Please take a little time and carefully read all of the superbadge instructions--- The answers are there, but not super obvious! You can do it! :)
DeleteHi,
DeleteTried all the three options still same error,not getting what is going wrong, got stuck in this from few days..
Sales Executive: Users in this role can view all opportunities associated with accounts that they own, regardless of who owns the opportunities
Field Sales:Users in this role can view all opportunities associated with accounts that they own, regardless of who owns the opportunities
Inside Sales: Users in this role can edit all opportunities associated with accounts that they own, regardless of who owns the opportunities
In apex Test one class error is like this:
Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user
Please help me
Thanks
Trailhead Baby does not give "answers" because that takes away the challenge from the Superbadge, however, you really really really should do a review of the instructions!
DeleteBrilliant Article, I am looking for this type of article from many days. Thanks for sharing this with us. Fahim Moledina
ReplyDeleteHi,
ReplyDeleteI am not able to pass the second apex test even after creating all the 4 sharing rules.
The error comes out to be like this:
System.AssertException: Assertion Failed: Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user. #sadtrombone: Expected: 1, Actual: 3
This means that there is an issue either in the Profile, Sharing Rules, or Roles. If you want to share what you have, I'll take a look.
DeleteAccount Sharing Rules:
ReplyDeleteOwner in Role and Subordinates: Sales Executive Role: Field Sales Read/Write Private Private
Owner in Role and Subordinates: Sales Executive Role: Inside Sales Read/Write Private Private
Opportunity Sharing Rules
(Opportunity: StageEQUALSClosed Won) AND (Opportunity: TypeEQUALSExisting Customer - Upgrade)
Group: Project Managers Read Only
Owner in Role and Subordinates: Sales Executive Role: Field Sales Read/Write
Roles
Field Sales AND Inside Sales reports to Sales Executive
Sales Executive reports to GenZ Capital
Profiles
I have completed first challenge's requirement based on which profiles were made.
Incorrect sharing rule for Inside Sales.
DeleteYeah I have corrected it and passed the challenge, Thank you.
DeleteHello
ReplyDeleteI am unable to pass the one of the apex test cases after creating the sharing rules.
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “Opportunity Management” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: REQUIRED_FIELD_MISSING: Required fields are missing: [AccountId]. You can look up ExceptionCode values in the SOAP API Developer Guide.: []
DeleteClass.sb_security.BeAwesome.hugYourMother: line 77, column 1
Share what you have and I'll take a look!
DeleteHi Trailhead baby...
ReplyDeleteI get the below error msg when checking the challenge 2 of Security Specialist.
Challenge Not yet complete... here's what's wrong:
The unit tests in the managed package have not passed successfully. Make sure you run all test in your org before checking this section. Ensure that they all pass.
What is the result of the package test? Typically the issue is in a profile or one of the sharing rules.
DeleteSystem.AssertException: Assertion Failed: Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user. #sadtrombone: Expected: 1, Actual: 3
ReplyDelete@whoever got this error, the clue is go back to your roles and check that you have created them correctly.
Hint: Check "reporting to" field.
Basic mistake but solved the issue and passed the assignment.
Is anyone available to assist here? I am on step 2 of the security specialist superbadge and I am still having a license issue.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteHii Trailhead baby
ReplyDeleteError Message System.AssertException: Assertion Failed: Field Sales users should not be able to read Opportunities owned by someone else. However, the test returned records not owned by the user. #sadtrombone: Expected: 1, Actual
This is my problem .. pls help me
Hi. I realize this is a really newb question, but I'm lost setting up the public group. I can't figure out for the life of me who should be in it. I was thinking role: Project Managers, but there are two problems with that.
ReplyDelete1. I don't know where in the role hierarchy the position would go (nothing says and I can't find the answer online).
2. The instructions specifically say not to use a role for sharing records with project managers. I realize I could be reading this too literally and that I could accomplish it with sharing rules. But that brings me back to the public group. I'm guessing I still need a role for the project managers to put in the public group for the rule (but then couldn't you just use the role for the sharing rules?). And it also comes back to question 1, where in the role hierarchy do they go?
Techforce services is a Salesforce Consulting Services in Australia Specializing in delivering end to end Salesforce solutions ,Consulting, Implementation DevOps partners in Australia We deliver applications and services more rapidly and reliably, but it’s more than a methodology – it cuts to the very core. Salesforce Data Analytics let us help you become a data driven organization and ensure your data is working hard for your business, This includes implemention
ReplyDeleteSalesforce consulting companies
Salesforce Services
Staff augmentation companies
Salesforce integration companies
Salesforce Implementation services
Salesforce Health Check
Salesforce DevOps
Managed project services
hey i how can i login as samantha and how can i complete security superbadge chanllenge 2 ?
ReplyDeleteThanks, it was very tricky part as Apex fail...with errors:
ReplyDeleteClass.sb_security.BeAwesome.createUser: line 133, column 1
Class.sb_security.BeAwesome.setup: line 127, column 1
until the moment that i created the last missing role of the 3 and i created the role hierarchy (i am not sure if it is necessary but i did). Of course i did all the mentioned steps above.