Tips for Passing the Lightning Web Components Specialist Superbadge – Challenge 3
This post describes about the Lightning Web Components Specialist Superbadge Challenge 3 Guide (Tips and Guidelines).
Lightning Web Components Specialist Superbadge Challenge 3: Get BoatDataService class ready for action
To Pass the Lightning Web Components Specialist Superbadge Challenge 3, require the Knowledge about Apex Class.
- Retrieve BoatDataService Apex Class & Modification
- Retrieve Apex Class Using Org Browser or SFDX:CLI Commands using Visual Studio Code or 3rd party editors
- To adding the client-side caching in the BoatDataService Apex Class
@AuraEnabled(cacheable=true) or @AuraEnabled
Refer the Video Lightning Web Components Specialist Superbadge Guide/Tips – Challenge 1 & Challenge 3, to possible way to retrieve the unlocked package component from trailhead playground to visual studio code.
Use to the following SFDX CLI Command to Retrieve Apex Class and LWC Component:
LWC Component :
sfdx force:source:retrieve -m LightningComponentBundle:boatMap
//here boatMap is a LWC Component Name
//LightningComponentBundle is LWC Component Type Name
Apex Class:
sfdx force:source:retrieve -m ApexClass:BoatDataService
//here BoatDataService is a Apex Class Name
Possible Errors:
We can’t find the correct settings for the method getBoats() in the BoatDataService class. Make sure the adjustments to this class were made according to the requirements, including marking or not the method as cacheable.
We can’t find the correct settings for the method getSimilarBoats() in the BoatDataService class. Make sure the adjustments to this class were made according to the requirements, including marking or not the method as cacheable.
We can’t find the correct settings for the method getBoatTypes() in the BoatDataService class. Make sure the adjustments to this class were made according to the requirements, including marking or not the method as cacheable.
We can’t find the correct settings for the method getAllReviews() in the BoatDataService class. Make sure the adjustments to this class were made according to the requirements, including marking or not the method as cacheable.
We can’t find the correct settings for the method getBoatsByLocation() in the BoatDataService class. Make sure the adjustments to this class were made according to the requirements, including marking or not the method as cacheable, returning a serialized string.
Tips/Guide to passing the LWC Challenge 3:
- Retrieve the BoatDataService ApexClass from unlocked package (use to retrieve with Org Browser or SFDX CLI Commands sfdx force:source:retrieve -m ApexClass:BoatDataService from Visual Studio Code)
- Read instruction carefully and add the client-side caching to enable properly ie: @AuraEnabled(cacheable=true) OR @AuraEnabled
- getAllReviews method in BoatDataService ApexClass is not cacheable as per the instruction so then use appropriate annotations.
Reference Link:
Call Apex Methods – https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex
AuraEnabled Annotation – https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_apex_auraenabled_annotation.htm
Refer the following post about the Tips for Passing the Lightning Web Components Specialist Superbadge Challenges:-
- Lightning Web Components Specialist Challenge 1
- Lightning Web Components Specialist Challenge 2
- Lightning Web Components Specialist Challenge 3
- Lightning Web Components Specialist Challenge 4
- Lightning Web Components Specialist Challenge 5
- Lightning Web Components Specialist Challenge 6
- Lightning Web Components Specialist Challenge 7
- Lightning Web Components Specialist Challenge 8
- Lightning Web Components Specialist Challenge 9
- Lightning Web Components Specialist Challenge 10
- Lightning Web Components Specialist Challenge 11
- Lightning Web Components Specialist Challenge 12
- Lightning Web Components Specialist Challenge 13
- Lightning Web Components Specialist Challenge 14
- Lightning Web Components Specialist Challenge 15
- Lightning Web Components Specialist Challenge 16
- Lightning Web Components Specialist Challenge 17
- Lightning Web Components Specialist Challenge 18
The post Tips for Passing the Lightning Web Components Specialist Superbadge – Challenge 3 appeared first on TheBlogReaders.com.