You need to sign in to do that
Don't have an account?

Trailhead-STEP: Sharing Rules for External Users
This Step of the Trailhead "" seams to have a BUG!:
After reviewing the exercise several times, I am getting this error:
Is any want suffering the same issue?
Any tip?
Thank you very much.
After reviewing the exercise several times, I am getting this error:
Step not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has no rows for assignment to SObject
There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has no rows for assignment to SObject
Is any want suffering the same issue?
Any tip?
Thank you very much.
All Answers
I trust you are doing very well.
It is most likely an org issue. It might possible that there is an existing customization (like Apex or an AppExchange app) that was interfering with the challenge.
I suggest you please use a new Developer Org / Trailhead Playground for validating the challenge. That has fixed a lot of problems for me in the past.
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in future.
Thanks and Regards,
Khan Anas
I've double checked the sharing rules and the public group, and everything seems alright.
After too many retries, I've missed one of the mains steps "Set Your Org's External Org-Wide Defaults". Just check you've followed all steps, not just "Use Sharing Rules for External Users" step. This was my mistake to get this error.
Regards,
I've enabled the external sharing model, and for the Opportunity and 'Account and Contract' objects, I've set the Default Internal Access to Public Read Only and the Default External Access to Private. Still, no acceptance on the sharing rules challenge..
My mistake was not completing https://trailhead.salesforce.com/content/learn/projects/communities_share_crm_data/set_external_owd part. I've created new Playground and followed each step, and it works now.
Regards,
Thanks for your suggestion, I followed what you wrote by disabling e re-enabling two partner contact, but also, when I re-enabled the last of the two I got another message error and I had to give a partner manager role instead of the partner user role, and it worked for me.
I have the same error as you, and I have double checked everything. Did you find a solution to this Trailhead?
Trailhead executes its tests under your user's scope. If you create a debug log, you will be able to see whats wrong. in my case, trailhead executed a bunch of SOQL queries and it failed when it attempted this one and came with NULL results, possibly because the dev who worked exception management on this one got a bit lazy:
SELECT RecordId, MaxAccessLevel, HasReadAccess, HasEditAccess FROM UserRecordAccess WHERE (UserId = :tmpVar1 AND RecordId = :tmpVar2)
In my case:
- For the 1st module, Salesforce failed to Global Find Sean Forbes's contact. So I created him manually- Bad idea.
- I deleted my Sean Forbes contact later, when the original just showed up ... but... the user was just deactivated, not deleted. This gives my org 2 Sean Forbes users, 1 inactive non-withstanding.
- The trailhead code simply looks for a Sean Forbes. Found the Id for the inactive one, and proceeded to throw our unmanaged exception.
- Renaming the inactive Sean Forbes and adding a few records using workbench nudged trailhead into giving me the win. No need to re-do it all again.
Takeaway?That totally solved my issue.
1. Renamed the inactive Sean Forbes to XSean XForbes,...
2. I found out that one opp. underneath Express Logistics was owned by an inactive partner community user which was renamed by me before to Rosey Gonzalezy. I changed the owner to an active user.
Crazy but true: Then I got the 100 points and was able to continue.
If you have multiple users having same name as mentioned in the module, then just disable duplicate inactive users and renaming First and last names of the corresponding disabled users fixed it.
Huuraayyy...
Hope this would simply fix your problem.
Just rename the inactive user with an X in front of the name!
1. Renamed the inactive Sean Forbes to XSean XForbes
2. Set Debug Logs - Checked the exception
15:22:32.19 (19949232)|EXECUTION_STARTED
15:22:32.19 (19975519)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex
15:22:32.19 (20793033)|VARIABLE_SCOPE_BEGIN|[1]|contacts|List<Contact>|true|false
15:22:32.19 (20909079)|VARIABLE_SCOPE_BEGIN|[7]|opp|Opportunity|true|false
15:22:32.19 (20941265)|VARIABLE_SCOPE_BEGIN|[8]|ura|UserRecordAccess|true|false
15:22:32.19 (20982549)|VARIABLE_SCOPE_BEGIN|[3]|users|List<User>|true|false
15:22:32.19 (21007781)|VARIABLE_SCOPE_BEGIN|[5]|users2|List<User>|true|false
15:22:32.19 (21356112)|HEAP_ALLOCATE|[79]|Bytes:3
15:22:32.19 (21423505)|HEAP_ALLOCATE|[84]|Bytes:152
15:22:32.19 (21443154)|HEAP_ALLOCATE|[399]|Bytes:408
15:22:32.19 (21464462)|HEAP_ALLOCATE|[412]|Bytes:408
15:22:32.19 (21480065)|HEAP_ALLOCATE|[520]|Bytes:48
15:22:32.19 (21510349)|HEAP_ALLOCATE|[139]|Bytes:6
15:22:32.19 (21964936)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:20
15:22:32.19 (22693877)|STATEMENT_EXECUTE|[1]
15:22:32.19 (22973655)|STATEMENT_EXECUTE|[1]
15:22:32.19 (22986089)|HEAP_ALLOCATE|[1]|Bytes:63
15:22:32.19 (23017196)|HEAP_ALLOCATE|[1]|Bytes:4
15:22:32.19 (23126247)|HEAP_ALLOCATE|[52]|Bytes:5
15:22:32.19 (23160985)|HEAP_ALLOCATE|[58]|Bytes:5
15:22:32.19 (23173936)|HEAP_ALLOCATE|[66]|Bytes:7
15:22:32.19 (23968811)|SOQL_EXECUTE_BEGIN|[1]|Aggregations:0|SELECT accountid FROM contact WHERE name = 'Josh Davis' LIMIT 1
15:22:32.19 (32779568)|SOQL_EXECUTE_END|[1]|Rows:1
15:22:32.19 (32814320)|HEAP_ALLOCATE|[1]|Bytes:8
15:22:32.19 (32845514)|HEAP_ALLOCATE|[1]|Bytes:82
15:22:32.19 (32882383)|HEAP_ALLOCATE|[1]|Bytes:8
15:22:32.19 (33178205)|VARIABLE_ASSIGNMENT|[1]|contacts|[{"AccountId":"0010o00002IUiXCAA1","Id":"0030o00002iYsmoAAC","CurrencyIsoCode":"USD"}]|0x27254947
15:22:32.19 (33308734)|STATEMENT_EXECUTE|[2]
15:22:32.19 (33608865)|STATEMENT_EXECUTE|[3]
15:22:32.19 (33616316)|HEAP_ALLOCATE|[3]|Bytes:54
15:22:32.19 (33639440)|HEAP_ALLOCATE|[3]|Bytes:4
15:22:32.19 (33650813)|HEAP_ALLOCATE|[3]|Bytes:7
15:22:32.19 (33697077)|HEAP_ALLOCATE|[3]|Bytes:16
15:22:32.19 (34129384)|SOQL_EXECUTE_BEGIN|[3]|Aggregations:0|SELECT id FROM user WHERE contactid = :tmpVar1 LIMIT 1
15:22:32.19 (39902106)|SOQL_EXECUTE_END|[3]|Rows:1
15:22:32.19 (39930133)|HEAP_ALLOCATE|[3]|Bytes:8
15:22:32.19 (39963598)|HEAP_ALLOCATE|[3]|Bytes:51
15:22:32.19 (40000393)|HEAP_ALLOCATE|[3]|Bytes:8
15:22:32.19 (40120860)|VARIABLE_ASSIGNMENT|[3]|users|[{"Id":"0050o00000XRPDiAAP","CurrencyIsoCode":"USD"}]|0x61f16ea4
15:22:32.19 (40147455)|STATEMENT_EXECUTE|[4]
15:22:32.19 (40252138)|STATEMENT_EXECUTE|[5]
15:22:32.19 (40258841)|HEAP_ALLOCATE|[5]|Bytes:151
15:22:32.19 (40280075)|HEAP_ALLOCATE|[5]|Bytes:4
15:22:32.19 (40935108)|SOQL_EXECUTE_BEGIN|[5]|Aggregations:0|SELECT name, Id, User.Profile.UserLicense.Name FROM User WHERE (Name IN ('Josh Davis') AND User.Profile.UserLicense.Name = 'Partner Community') LIMIT 1
15:22:32.19 (52187053)|SOQL_EXECUTE_END|[5]|Rows:1
15:22:32.19 (52217363)|HEAP_ALLOCATE|[5]|Bytes:8
15:22:32.19 (52268767)|HEAP_ALLOCATE|[5]|Bytes:263
15:22:32.19 (52316751)|HEAP_ALLOCATE|[5]|Bytes:8
15:22:32.19 (52400489)|VARIABLE_ASSIGNMENT|[5]|users2|[{"Name":"Josh Davis","Id":"0050o00000XRPDiAAP","ProfileId":"00e0o0000037emvAAA","CurrencyIsoCode":"USD","Profile":{"Id":"00e0o0000037emvAAA","UserLicenseId":"1000o0000024KwSAAU","UserLicense":{"Id":"1000o0000024KwSAAU","Name":"Partner Community","TotalLicenses":5}}}]|0x4829923e
15:22:32.19 (52440177)|STATEMENT_EXECUTE|[6]
15:22:32.19 (52560644)|STATEMENT_EXECUTE|[7]
15:22:32.19 (52570674)|HEAP_ALLOCATE|[7]|Bytes:58
15:22:32.19 (52600773)|HEAP_ALLOCATE|[7]|Bytes:4
15:22:32.19 (52918914)|SOQL_EXECUTE_BEGIN|[7]|Aggregations:0|SELECT Id FROM Opportunity WHERE Name = 'Edge SLA' LIMIT 1
15:22:32.19 (58615160)|SOQL_EXECUTE_END|[7]|Rows:0
15:22:32.19 (58672705)|HEAP_ALLOCATE|[7]|Bytes:4
15:22:32.19 (58702682)|HEAP_ALLOCATE|[7]|Bytes:0
15:22:32.19 (58806951)|HEAP_ALLOCATE|[7]|Bytes:4
15:22:32.19 (58823112)|HEAP_ALLOCATE|[7]|Bytes:37
15:22:32.19 (59025391)|HEAP_ALLOCATE|[7]|Bytes:46
15:22:32.19 (59693786)|FATAL_ERROR|System.QueryException: List has no rows for assignment to SObject
SELECT Id FROM Opportunity WHERE Name = 'Edge SLA' LIMIT 1 - This is the error.
Cloned an Opportunity using Edge Installation and named it as Edge SLA and Saved.
Challenge Successful
Thanks for this tip. This tip is helpful to debug any trailhead challenge...
During the process, I have had indeed too many repeated users created. And as you said, the Trailhead developer has done a poor job by throwing generic error.