You need to sign in to do that
Don't have an account?
umavidyullatha polavrapu
hi all, want help on soql query for the challange in 'building apex coding skills' propertyutility.can anyone help me on this
string propEmail;
list<property__C> newPropList=[select name,days_on_market__c,broker__r.email__c from property__c where date_listed__c>=LAST_N_DAYS:30];
system.debug('The list items are........:'+newPropList);
for(property__C p:newproplist)
{
propEmail=p.name+':'+p.broker__r.email__c;
system.debug('The concatenated string is.....:'+propEmail);
}
getting the following error:
Challenge not yet complete in My Trailhead Playground 2
We can’t find the correct SOQL query in the PropertyUtility class.
this is my solution..any corrections let me know..tq
list<property__C> newPropList=[select name,days_on_market__c,broker__r.email__c from property__c where date_listed__c>=LAST_N_DAYS:30];
system.debug('The list items are........:'+newPropList);
for(property__C p:newproplist)
{
propEmail=p.name+':'+p.broker__r.email__c;
system.debug('The concatenated string is.....:'+propEmail);
}
getting the following error:
Challenge not yet complete in My Trailhead Playground 2
We can’t find the correct SOQL query in the PropertyUtility class.
this is my solution..any corrections let me know..tq
All Answers
Try below code and it should work.
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
public static void newListedProperties(){
List<Property__c> newPropList = [Select Name,id,Days_On_Market__c,Broker__r.Email__c from Property__c where Days_On_Market__c <31];
for(Property__c proplist :newPropList){
String propEmail = proplist.name+':'+proplist.Broker__r.Email__c;
system.debug(propEmail);
}
}
}
public static void newListedProperties(){
List<Property__c> newPropList = [SELECT Name, Broker__r.Email__c, Days_On_Market__c FROM Property__c
WHERE Days_On_Market__c <= 30];
for ( Property__c prop: newPropList){
String propEmail = prop.Name + ' : '+ prop.Broker__r.Email__c;
System.debug(propEmail);
}
}
}
Public Static Void newListedPropertie()
{
List<Property__c> newPropList=[SELECT Name, Broker__r.Email__c,Days_On_Market__c FROM Property__c where Date_Listed__c= LAST_N_DAYS:30];
for (Property__c Prop: newPropList)
{
String propEmail= 'Property Name'+Prop.Name+':' +'Broker Email'+Prop.Broker__r.Email__c;
System.debug(propEmail);
}
}
}