We have a customer community portal in one of our Dev Org (this Dev Org is currently in Spring'19).

As per business logic, Community logged in User need to query/fetch User's Id from User Object by providing any username.

For example:

String user_name = 'dev_test2@abcd.com.test'; //I have checked this user is present in the Dev Org
User u = [SELECT ID FROM User where Username =:user_name LIMIT 1]; //Getting List has no rows for assignment to SObject error though provided proper/existing username
  1. I drilled down more, I have found Licence type of provided username dev_test2@abcd.com.test is Salesforce.
  2. Also I have tried (as Community logged in User) to fetch User Id for Salesforce/Salesforce Platform/Customer Community Licence type Users. But result is positive for those user who are assigned with Customer Community Licence.
  3. I have tried (as Guest Community User) to fetch User Id for Salesforce/Salesforce Platform/Customer Community Licence type Users. YES I am able to fetch records of all types of Users (irrespective of Licence type).

Is this due to Spring'19 release?

  • So this was working in Winter 19 and earlier versions? Can you clarify #2 by including the soql statement? You are saying the query returns only Customer Community users and not any Salesforce or Salesforce Platform license users? – David Cheng Jan 10 '19 at 21:13
  • Yes David, this was working with Winter 19 and earlier versions. Reg point#2, lets say I am searching for User abvfdd@hhhhg.com.ggg (this user is assigned to customer community license) then only system is allowing me to fetch the result. Else for any Salesforce or Salesforce Platform license users, system is not returning result. – Avijit Jan 11 '19 at 2:59
  • Any one faced such issue in Spring'19 Org? – Avijit Jan 14 '19 at 14:05
  • The knowledge article in the answer below has information that should help your issue. My comment to that answer points to the release note that is causing this issue in the Spring '19 release. – justinpdove Jan 14 '19 at 19:20

If you have your Class set to "without sharing" and your OWD is setup properly. Take a look at this knowledge article.


  • I don't know why this is -1, that knowledge article seems to nail specifically what the issue is with workarounds. Additionally, this change in the release notes seems to be what is causing the issue: releasenotes.docs.salesforce.com/en-us/spring19/release-notes/…. – justinpdove Jan 14 '19 at 19:19
  • Yeah I had that issue too, and its fixed in my sandbox already. – joshii Jan 14 '19 at 19:45
  • Thanks, I see Salesforce already fixed this issue. My impacted Org: CS85 – Avijit Jan 15 '19 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.