Skip to main content
Hello,i´m doing a trailhead.

 

The trailhead its: Create Relationship Queries with Custom Objects

 

And in the exercise show this error, but i dont know what its the mistake in my code.

 

We can’t find the correct SOQL query in the PropertyUtility class.User-added image

 

Someone can help me and show my error?

 

Thanks!!
4 answers
  1. Aug 25, 2020, 2:49 AM
    Hi Vinicius,

     

    You may try with below apex class:

     

     

    public class PropertyUtility{

    public static void newListedProperties(){

    List<Property__c> newPropList = [Select Name,Days_On_Market__c,Broker__r.Email__c from Property__c where Days_On_Market__c < 31];

    for(Property__c p : newPropList){

    string propEmail = p.Name +':'+ p.Broker__r.Email__c ;

    system.debug(propEmail);

    }

    }

    }

0/9000