Platform Developer I Certification Maintenance (Winter '22)
→ Get Ready for the Hands-on Challenge
In the hands-on challenge below, you’ll have an opportunity to work with the new Custom Metadata getInstance method to replace SOQL.
Launch the org you’ll use for the hands-on challenge, then follow below steps:
Create a Custom Metadata Type.
Step: 1
Find 'Custom Metadata Types' in 'Quick find' box and select the same option.
Click the 'New Custom Metadata Type' button.
Click the 'New Custom Metadata Type' button.
Step: 2
As mentioned in trailhead challenge, enter 'Label' and 'Plural Label' values, leave all options as it is,
- Label:
Country Code
- Plural Label:
Country Codes
Step: 3
Click 'New' button in 'Custom Fields' section for creating new field in custom metadata.
Step: 4
Select 'Text' data type and click 'Next' button.
Step: 5
As mentioned in trailhead challenge, enter 'Field Label' and 'Length' values,
- Field Label:
Country Code
- Length:
3
Step: 6
Leave all options as it is and click 'Save' button.
Step: 7
Now, click on 'Manage Country Codes' button for creating new record for custom metadata.
Step: 8
Click 'New' button.
Step: 9
As mentioned in trailhead challenge, enter 'Label' and 'Country Code' values,
- Label:
Canada
- Country Code:
CAN
Step: 10
After saving the record, it will look like below screenshot.
Step: 11
Now, as mentioned in trailhead challenge, we need to create one apex class.
Follow below steps in developer console To open the Developer Console from Salesforce Classic:
- Click Your Name.
- Click Developer Console.
To open the Developer Console from Lightning Experience:
- Click the quick access menu ().
- Click Developer Console.
~ File > New > Apex Class
Step: 12
As mentioned in trailhead challenge, enter 'Apex Class' name and click 'OK' button.
Class Name: CountryCodeHelper
Class Name: CountryCodeHelper
Step: 13
Copy below mentioned code and paste in developer console and 'save' this apex class.
CountryCodeHelper code:
Thank you nikhil for this quick guide.
ReplyDeleteThanks Nikhil
ReplyDeleteThank you!
ReplyDeleteThanks Budy
ReplyDeleteThanks alot :)
ReplyDeletethanks
ReplyDeleteThank you bhai saab!
ReplyDeleteThank you.
ReplyDeleteThanks alot
ReplyDeleteThanks a lot
ReplyDeleteThank you - very helpful!
ReplyDeletethank you buddy much appreciated, have a good one
ReplyDeleteThank you!
ReplyDelete