Hello @R Pious Wilfred Nicholas,
Try below code and it should work.
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);
}
}
}
Hope above information was helpful.
https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4LilSAF
#Trailhead Challenges2.444 utenti parlano di questo argomento
- Attività recente
- Data di creazione
- Consigliati
- Tutte le domande
- Domande con risposte accettate
- Domande senza risposta
- Domande senza risposta accettata
18 dic 2023, 03:30 Hi ,
Try it on your new playground.
Click this button to delete and create records using Apex code. If you can read Apex code, I think you can deal with this by modifying the code.
global with sharing class DreamHouseSampleDataController {
@RemoteAction
global static void deleteAll() {
DELETE [SELECT ID FROM favorite__c];
DELETE [SELECT ID FROM property__c];
DELETE [SELECT ID FROM broker__c];
DELETE [SELECT ID FROM bot_command__c];
}
}
https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007Rd3DRSAZ
For the challenge within
- SOQL for Admins
- Create Relationship Queries with Custom Objects
Every time I try to import the sample data I get the following error.
Error
Error while importing data
and it wont let me complete the challenge without the data.
SOQL for Admins > Create Relationship Queries with Custom Objects
I'm unable to complete the above lab
it's saying We can’t find the correct SOQL query in the PropertyUtility class.
But in logs I'm getting the values
Can anyone help me to resolve this
21 ott 2024, 07:50 Hi @MANJESH M ,
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);
}
}
}
https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8xshSAB