I have tried creating new playground and working on it.
created classes,lwc with sfdx command prompt only.
saved all the components.
But still facing the error.Please tell me know if there is any resolve.
Try creating the Apex class via Developer Console and save it. Then from your VSC deploy just LWC.
Hi @Sindhura Kundurthi This issue needs further review and we may need access to your playground. We will reach out to you via email to connect further.
Best Regards,
Ravi
++CreateTrailheadCase
@Sindhura Kundurthi Check the file structure of the project. Most likely, the issue lies there. The compiler cannot find the required files at the specified path.
Try to use this code: LINK
Sincerely,
Mykhailo Vdovychenko
Bringing Cloud Excellence with IBVCLOUD OÜ
@Mykhailo Vdovychenko my trailhead challenge is about "Deploy a Component That Lists Contacts" which is the challenge given in the module "Use Apex to work with Data". I think the code you have provided me is relevant for the challenge in the module "Handle server errors". Please correct me if iam wrong.
The following is the error iam getting now. It says "Cannot find Lightning Component Bundle WorkingWithDataInLWC". Please suggest. Attaching the screenshot for reference.
@Sindhura Kundurthi Compare your code with provided code:
ContactController:
public with sharing class ContactController { @AuraEnabled(cacheable=true) public static List<Contact> getContacts() { // The following line is used only for the last challenge throw new AuraHandledException('Forced error'); // return [SELECT FirstName, LastName, Email FROM Contact WITH SECURITY_ENFORCED ORDER BY LastName, FirstName]; }}
AccountController:
public with sharing class AccountController { @AuraEnabled(cacheable=true) public static List<Account> getAccounts() { // The following line is used only for the last challenge throw new AuraHandledException('Forced error'); // return [SELECT Name, AnnualRevenue, Industry FROM Account WITH SECURITY_ENFORCED ORDER BY Name]; } @AuraEnabled(cacheable=true) public static List<Contact> getRelatedContacts(Id searchId) { return [SELECT Name, Title, Email, Phone FROM Contact WHERE AccountId = :searchId WITH SECURITY_ENFORCED]; }}
https://github.com/gvgramazio/trailhead-module-lightning-web-components-and-salesforce-data
Sincerely,
Mykhailo Vdovychenko
Bringing Cloud Excellence with IBVCLOUD OÜ
@James Bengel I have checked my profile access i.e "System Administrator Access" in my org. I have access to the class 'ContactController' . I have attached the screenshot. Please let me know whether i need to check anything else.
Have you checked your profile/applicable permission sets to see if you have permission to access the class? That would be my first guess.
You'll find it under Setup -> Users -> Profiles or Setup -> Users -> Permission Sets in the Apps section. In either case, it will look like this:
That's been a requirement for some time now, but it's possible the Trailhead unit wasn't updated to include it. Or that it was assumed you'd know this.)
Compare your code with provided code:
ContactController:
public with sharing class ContactController {
@AuraEnabled(cacheable=true)
public static List<Contact> getContacts() {
// The following line is used only for the last challenge
throw new AuraHandledException('Forced error');
// return [SELECT FirstName, LastName, Email FROM Contact WITH SECURITY_ENFORCED ORDER BY LastName, FirstName];
}
}
AccountController:
public with sharing class AccountController {
@AuraEnabled(cacheable=true)
public static List<Account> getAccounts() {
// The following line is used only for the last challenge
throw new AuraHandledException('Forced error');
// return [SELECT Name, AnnualRevenue, Industry FROM Account WITH SECURITY_ENFORCED ORDER BY Name];
}
@AuraEnabled(cacheable=true)
public static List<Contact> getRelatedContacts(Id searchId) {
return [SELECT Name, Title, Email, Phone FROM Contact WHERE AccountId = :searchId WITH SECURITY_ENFORCED];
}
}
Sincerely,
Mykhailo Vdovychenko
Bringing Cloud Excellence with IBVCLOUD OÜ