+ Start a Discussion
Somnath LokeshSomnath Lokesh 

The sharing rule did not behave as expected.... TrailHead Challenge

Working on TrailHead Challenge... (https://developer.salesforce.com/trailhead/force_com_introduction/data_security/data_security_sharing_rules)

Tasks completed:
The custom object must be named 'Project' with a resulting API name of 'Project__c'.   Done
The Name field for 'Project' must be of type Text (not Auto-Number).  Done
The custom object 'Project' must have a custom field of type picklist named 'Priority' with a resulting API name of 'Priority__c'. Done
The role label should be 'Training Coordinator' with the resulting 'Role Name' of 'Training_Coordinator'. Note that you may already have this role in your role hierarchy from a previously attempted challenge.   Done
Set the organization wide settings to public read only.    Done

Here is where I think is the problem:
The sharing rule can be named anything.  
 
Create sharing rule under "Sharing Settings" under Project Sharing Rules..  Create a criteria based project sharing rule with Priority custom field equal to High.  Shared with role "Training Coordinator" as read-only access.


What am I missing?
Best Answer chosen by Somnath Lokesh
Jennifer W. LeeJennifer W. Lee
In this challenge, it noted that the OWD should not be set to public read/write. I see you set yours to Public Read Only and you have the sharing rule set to Read Only. But when you think about the actual use case, if the object is already set to public read only, which means everyone can see all the project records, there is no need to have a sharing rule also set to read only, since without the sharing rule, the records are already read only. Sharing rules open up access to records from the setting of OWD. Make sense?

All Answers

Jennifer W. LeeJennifer W. Lee
Can you provide a screenshot of your sharing rule?
Somnath LokeshSomnath Lokesh
See attached Sharing settings...
Sharing Rules Settings...
Jennifer W. LeeJennifer W. Lee
In this challenge, it noted that the OWD should not be set to public read/write. I see you set yours to Public Read Only and you have the sharing rule set to Read Only. But when you think about the actual use case, if the object is already set to public read only, which means everyone can see all the project records, there is no need to have a sharing rule also set to read only, since without the sharing rule, the records are already read only. Sharing rules open up access to records from the setting of OWD. Make sense?
This was selected as the best answer
Somnath LokeshSomnath Lokesh
Hi Jennifer, 
   Thanks for the clarification. So, I remove access to Public Read in the OWD.  I'll give this a try and get back to you.

Thanks,
Somnath
Somnath LokeshSomnath Lokesh
It Worked based on your suggestion.  Thanks.
Jennifer W. LeeJennifer W. Lee
Awesome. Glad I could help!
Andrew EversleyAndrew Eversley
Hello All, I have a question regardin this challenge. 

As far as the below criteria do I have to create a role for this or a public group? 

The role label should be 'Training Coordinator' with the resulting 'Role Name' of 'Training_Coordinator'. Note that you may already have this role in your role hierarchy from a previously attempted challenge.

I see in Somnath's earlier screen shot that under the project sharing rule it was Shared with "Role Training Coordinator" just wanted to know how and where that was created. Thanx in advance.
Andrew EversleyAndrew Eversley
Please disregard the last post for an answer. I figured out what the issue was. 
Chris BackesChris Backes
I have not been able to work this one out. I am getting the same error message that @Somnath was originally getting and have confirmed that my OWD are not set to Public Read Only. My sharing settings for project look exactly like @Somnath's screenshot with the exception that OWD is set to Private. Any help in understanding this one would be appreciated. Thanks!

 
gary norrisgary norris
@chris were you able to figure out what was wrong with this challenge?? I seem to be where you are and can't figure out what is missing?! User-added imageUser-added imageUser-added image
Chris BackesChris Backes

@gary - I have not yet, I moved onto other modules to keep moving forward. Will eventually get back to it and if I get it figured out will keep you posted.
Marc Zaharescu 1Marc Zaharescu 1
@gary norris  - As I can see from your 1st screen shot your Project Sharing Rule is set for Project.Owner instead of Project.Priority, if you still got issues after fixing this try to dissable the 'Grant Access Using Hierarchies' from OWD
Richard ClarkenDevRichard ClarkenDev
Look at the field visibility of the Priority__c field on the project__c object and make sure it is checked 'visible' for the System Administrator profile.  Otherwise Salesforce cannot validate your results.
Lizzie KingLizzie King
Hi guys 

I had the same problem I solved it with the following:
  • I had another custom field which was effecting my share settings (deleted this)
  • I changed my Field Accessibility on Priority for all users and profiles to unselected except for the System Administrator 
I noticed that two profiles where interacting with my Project object and changing the visability.
Hope this helps. 

 
Cole StewartCole Stewart
@Lizzie King removing the "Project" field from the Project Object  that was needed to complete a prior exercise solved the problem for me as well.
Vinicius FranciscoVinicius Francisco
Hello Guys,
Im getting the same error and it has been 2 days trying and i could not find what im missing.

Here follows some prints:

User-added image
User-added image
User-added image

Thanks in advance,
Gueorgui IskrovGueorgui Iskrov
Hello All!Who have The sharing rule did not behave as expected.... Please check 
Default Internal Access to Private in Organization-Wide Sharing Defaults Edit
ryoutakaryoutaka

My share rule was not anything wrong but not enough space for creating any records. After deleting all records and files, Challenge was completed.

Please check company Information - Used Data Space and Used File Space.

Brian PBrian P
[quote]
Gueorgui Iskrov
Hello All!Who have The sharing rule did not behave as expected.... Please check 
Default Internal Access to Private in Organization-Wide Sharing Defaults Edit
[/quote]

Written out a little different:
  1. Go to 'Setup' then 'Administrator -> Security Controls -> Sharing Settings
  2. Click 'Edit'
  3. Select your 'Project' custom object and change the drop down for 'Default Internal Access' to 'Private'
Additionally I had a 'Project' custom object from a previous module and even though it was labeled correctly I had to delete it completly for whatever reason to get it to regonize it.

The test instructions on this particular module where not very clear.
Ryan Adams 173Ryan Adams 173
How do I get the Project Sharing Rules "Shared with" to reflect "Role: Training Coordinator"?
Stephanie RallsStephanie Ralls
To summarize, the OWD should be set to Private (keep Grant Access Using Hierarchies enabled) and the project sharing rules should give the training coordinator Read Only access. This is where I got tripped up.
Rajat VijaywargiyaRajat Vijaywargiya
Hi @stephanie...I tried above steps, still getting an error "The sharing rule did not behave as expected.". Please help. Screenshot mentioned below.
User-added image
Pooja Gupta 54Pooja Gupta 54

@Vinicius Francisco

As I can see from your first screenshot you have set the default internal and external access to Public read only, where is it must be private. Plus select the checkbox for default access ussing hierarcies. I thnik this must solve your issue. I was geeting the same error but then it was resolved when I did this:

User-added image

Pooja Gupta 54Pooja Gupta 54

@Rajat Vijaywargiya

You have given the wrong criteria. Refer the screenshot.

User-added image

Alan HernandezAlan Hernandez

The sharing rule did not behave as expected.... TrailHead Challenge

To solve this problem, the only thing I had to do was change the access of the OWD (Organization-Wide Defaults) to private mode.

User-added image

I hope this comment can be helpful.

Adwait GogateAdwait Gogate
Thanks Jennifer W Lee it worked.... Cheers!!!
JaredHJaredH
User-added image

I too am having this error. I read through the posts here and I don't know what I am missing.
Yannick Berthoud 7Yannick Berthoud 7
Dear,

I have the same problem:

User-added image

User-added image

Do you have any solutions about this ?
yi zhang 43yi zhang 43
I changed "share with" from role and subordinates : Training Coordinator to Role: Training Coordinator , then it works. 
 
Josué PeixotoJosué Peixoto
Default Internal Access must be "Private".

Regard
Edward BruntonEdward Brunton
I also found that yi zhang 43's solution to work.
Jack LavousJack Lavous
I have tried yi zhang 43's solution as well as look through the feed above and I still can't get rid of the error. To summarise;
  • OWD is set to Private
  • I have tried 'share with' roles and subordinates as well as role.
Can anyone suggest anything else?
Regards
Erina McPhersonErina McPherson
So you have your 'Share With' roles selected as just 'role', right? Not 'roles and subordinates'? 
Nirvik MitterNirvik Mitter

Yes Erina.

"So you have your 'Share With' roles selected as just 'role', right?"  Training Coordinator ONLY.

 

Jack,

Try make it happen with ANOTHER ORG, it will work.

Renato RibasRenato Ribas
After one our and 30 minutes deleting and recreating the entities in the exrcise multiple times I tried yi zhang 43's solution and it fixed:

yi zhang 43
I changed "share with" from role and subordinates : Training Coordinator to Role: Training Coordinator , then it works. 

THANKS!
Maxym MaxMaxym Max
Try to choose " Rolse " not " Roles and Subordinates"!!!!Thats why!!!!! =)
Matt Larson Idea MachineMatt Larson Idea Machine

If you have done all the other steps accurately, this could be your potential blocker. The last line in the Data Security>Data Sharing Rules Trailhead makes you think that the Default Internal Access for the Project object should be Read Only. This will cause validation of the Challenge to return the error: The sharing rule did not behave as expected.

This was the solution that worked for me: 
Sharing Settings > Organizational-Wide Defaults and set the Default Internal Access for the 'Project' object to Private and not Read Only.

 

Sabrina Perardt 2Sabrina Perardt 2
I have this error too. I followed the suggestion to change "Share with: roles and subordinated" to "Share with: role"  and worked.
Spencer Duncan 3Spencer Duncan 3
I get the same "The sharing rule did not behave as expected" error as everyone above.
There was a piece in this unit that seemed off to me. In #5, it says, select SW Dev Manager, Director Product Management, and Director QA: 
User-added image
However, I don't have the SW Dev Manager, Director Product Management, and Director QA roles available:
User-added image
Was I supposed to add those rules in a different unit and missed it? Is this why I'm getting the error??
Joseph ForlineJoseph Forline
Good morning all,

I'm having similar issues.  Screen shots below - can anyone help?User-added image
User-added imageUser-added imageUser-added image