In the test class, the user's profile was specified in the Name item.
Profile prof = [SELECT Id, UserType, Name FROM Profile WHERE Name = :'ProfileName' LIMIT 1];
However, the following error occurred.
System.QueryException: List has no rows for assignment to SObject
If you specify by ID, no error will occur.Is it no longer possible to specify it in the Name field?
답변 5개
Hi @Shiori Nagamine ,
What language settings are you using?
In Japanese, I think ”ー” is added, like ”ユーザー”.
p = [select Id from Profile where Name = '標準 Platform ユーザー'];
https://ideas.salesforce.com/s/idea/a0B8W00000Gdf6dUAB/field-developername-in-profile-object