function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SUJAY GANGULY 5SUJAY GANGULY 5 

Challenge not yet complete in My Trailhead Playground 1 Ensure sharing rules from the calling class are enforced for the the 'UtilityClass' Apex class.

Geeting error at winter 19 Platfrom Developer 1 maintenance Certification:

Challenge not yet complete in My Trailhead Playground 1
Ensure sharing rules from the calling class are enforced for the the 'UtilityClass' Apex class.

Can you please help?
Manohar YenugulaManohar Yenugula
Please make class property as below : 
 
public inherited sharing class UtilityClass {
     public static List<sObject> queryObjects(String theObject, List<String> theFields, List<String> theFilters, String sortField, String sortOrder) {
          String theQuery = 'SELECT ' + string.join(theFields, ',');
          theQuery += ' FROM ' + theObject;
          boolean firstFilter = true;
          for (String filter : theFilters) { //loop through the filters
               String clauseToUse = (firstFilter) ? ' WHERE ' : ' AND '; //get the right clause
               filter = filter.trim();
               filter = filter.replaceAll('(\\s+)', ' ');  //remove white spaces
               theQuery += clauseToUse + filter;  //add the filter to the query
               firstFilter = false;  //changes the filter clause
          }
          if(!String.isEmpty(sortField)) {
               theQuery += ' ORDER BY ' + sortField;
               if(!String.isEmpty(sortOrder)) {
                    theQuery += ' ' + sortOrder;
               }
          }
          String theQueryResult = string.escapeSingleQuotes(theQuery);  //escapes the string
          return database.query(theQueryResult);
     }
}

 
Deepali KulshresthaDeepali Kulshrestha
Hi Sujay

Verify all class details as below, this worked for me

public inherited sharing class TowerMapUtilClass {....
public inherited sharing class TowerMapControllerClass {...
public inherited sharing class UtilityClass {....
Let me know if this works for you.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
Mohamed IthrisMohamed Ithris
HI Sujay

Change the Class first line:
From : public class UtilityClass
To:public inherited sharing class TowerMapUtilClass

Same as
From :public class TowerMapControllerClass
To:public inherited sharing class TowerMapControllerClass.

Thanks
Mohamed Ithris
Ajay K DubediAjay K Dubedi
Hi Sujay,
Verify all class details as below , this worked for me
1.public inherited sharing class TowerMapUtilClass {....
2.public inherited sharing class TowerMapControllerClass {...
3.public inherited sharing class UtilityClass {....
Let me know if this works for you.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Larko VupseLarko Vupse
Hi buddy, (https://mcdvoice.fyi/) did try mailing them with the validity end date, (https://talktowendys.fyi/) and ask for update? I guess that might help.
 
Regards, (https://dqfanfeedback.fyi/)
Larko Vupse


 
kamal raj 20kamal raj 20
Ensure sharing rules from the calling class are enforced for the the 'UtilityClass' Apex class?
Shankar Savant 5Shankar Savant 5
Guys i am getting this error "Challenge not yet complete in My Trailhead Playground 1", despite me installing the  DreamHouse app package
"Challenge issue