Maintain Your Platform Developer I Certification for Winter 24
Вставка
- Опубліковано 19 вер 2024
- Maintain Your Platform Developer I Certification for Winter 24
Platform Developer I Certification Maintenance (Winter '24),
Maintain Your Platform Developer I Certification for Winter 24,
Get Hands-on with Bind Variables in a SOQL Query
code===
in the comment section.
Hii, here we solve the problem of salesforce trailhead.
#trailhead
#salesforcetrailhead
#CertificationMaintenance
Winter 2024
Salesforce with shri ,Salesforcewithshri, withshri,shri
#Salesforcewithshri
Hii, here we solve the problem of salesforce trailhead.
please like share and subscribe
Thank You.
.
public class QueryContact {
public static Id getContactID(String lastName, String title) {
try {
Contact myContact = Database.query(
'SELECT ID FROM Contact WHERE lastName = :lastName AND title = :title LIMIT 1'
);
return myContact.Id;
} catch (Exception ex) {
return null;
}
}
public static Id getContactIDWithBinds(Map bindVars) {
//do not modify any code above this line
//implement the logic that will use bindVars to retrieve the contact's ID
String queryString = 'SELECT ID FROM Contact WHERE lastName = :lastName AND title = :title LIMIT 1';
return Database.queryWithBinds(
queryString,
bindVars,
AccessLevel.USER_MODE)[0].Id;
}
}
Thank you so much bro. This is very important task to maintain PD1 certification.
It's my pleasure
Thank you so much for sharing this. I was stuck with code challenge. Actually, I was initialising bindVars variable inside method with my own values which was casing issue. After commenting the line the challenge is completed successfully. Again thank you so much for sharing this. Keep it up!
Best Regards,
Dilip
Glad it helped!
code
in above comment