Platform API Superbadge Unit ||
1:01
Пікірлер
@gregorma7250
@gregorma7250 5 күн бұрын
Can you please release challenge 1 for everyone?
@vakshi8749
@vakshi8749 7 күн бұрын
I'm getting the below error, We can't find the correct items on your favourite list. Please anyone help me
@sheelambhavani1943
@sheelambhavani1943 22 күн бұрын
Please give the access to all the challenges of the Platform API superbadge Unit
@trailheadchallenge
@trailheadchallenge 22 күн бұрын
global class CredentialVerificationService { webservice static String verifyCredential(String lastName, String certificationName) { System.debug('Input Parameters - LastName: ' + lastName + ', CertificationName: ' + certificationName); String response = 'No record found'; // Query Contact based on LastName List<Contact> contacts = [SELECT Id FROM Contact WHERE LastName = :lastName LIMIT 1]; if (!contacts.isEmpty()) { Contact contact = contacts[0]; // Query Contact Certification based on CertificationName and Contact Id List<Contact_Certification__c> certifications = [ SELECT Id, isActive__c FROM Contact_Certification__c WHERE Name = :certificationName AND Contact__c = :contact.Id LIMIT 1 ]; if (!certifications.isEmpty()) { Contact_Certification__c certification = certifications[0]; if (certification.isActive__c) { response = 'Valid'; } else { response = 'Needs Renewal'; } } } System.debug('Response: ' + response); return response; } } -------------------------------------------------------------------- @isTest private class CredentialVerificationServiceTest { @isTest static void testVerifyCredential_Valid() { // Create test data Contact testContact = new Contact(LastName = 'Doe'); insert testContact; Certification__c cert = new Certification__c(Name='SalesforceCertification'); insert cert; // Create a Certification record Date issueDate = Date.today(); Contact_Certification__c testCertification = new Contact_Certification__c( isActive__c = true, Certification__c = cert.Id, // Replace with actual Certification Name Issue_Date__c = issueDate, Contact__c = testContact.Id ); insert testCertification; Contact_Certification__c conCert = [Select Name from Contact_Certification__c where contact__c = :testContact.Id]; Test.startTest(); String result = CredentialVerificationService.verifyCredential(testContact.LastName, conCert.Name); Test.stopTest(); // Verify the result System.assertEquals('Valid', result, 'Expected result to be "Valid"'); } @isTest static void testVerifyCredential_InactiveCertification() { // Create test data Contact testContact = new Contact(LastName = 'Smith'); insert testContact; Certification__c cert = new Certification__c(Name='Pilot Certification'); insert cert; // Create an inactive Certification record Date issueDate = Date.today().addYears(-2); Contact_Certification__c testCertification = new Contact_Certification__c( isActive__c = false, Certification__c = cert.Id, // Replace with actual Certification Name Issue_Date__c = issueDate, Contact__c = testContact.Id ); insert testCertification; Contact_Certification__c conCert = [Select Name from Contact_Certification__c where contact__c = :testContact.Id]; // Call the method to test Test.startTest(); String result = CredentialVerificationService.verifyCredential(testContact.LastName, conCert.Name); Test.stopTest(); // Verify the result System.assertEquals('Needs Renewal', result, 'Expected result to be "Needs Renewal"'); } @isTest static void testVerifyCredential_NoContact() { // Call the method with non-existent contact Test.startTest(); String result = CredentialVerificationService.verifyCredential('NonExistentLastName', 'Some Certification'); Test.stopTest(); // Verify the result System.assertEquals('No record found', result, 'Expected result to be "No record found"'); } @isTest static void testVerifyCredential_NoCertification() { // Create test data with a contact but no certification Contact testContact = new Contact(LastName = 'Johnson'); insert testContact; // Call the method to test Test.startTest(); String result = CredentialVerificationService.verifyCredential(testContact.LastName, 'NonExistentCertification'); Test.stopTest(); // Verify the result System.assertEquals('No record found', result, 'Expected result to be "No record found"'); } }
@trailheadchallenge
@trailheadchallenge 22 күн бұрын
------------------------------AssetService class----------------------- @RestResource(urlMapping='/lost') global without sharing class AssetService { @HttpPost global static String reportLostDevice (String assetIdentifier) { List<Asset> assets = [SELECT Id, Name, Asset_Identifier__c, Status,ContactId FROM Asset WHERE Asset_Identifier__c = :assetIdentifier]; if (assets.size() > 0) { assets[0].Status = 'Lost'; update assets[0]; List<Insurance__c> insurances = [SELECT Id, Asset__c FROM Insurance__c WHERE Asset__c = :assets[0].Id AND Coverage__c ='Comprehensive' AND Active__c = true LIMIT 1]; if (insurances.size() > 0) { List<Claim__c> claims = [SELECT Id,Name FROM Claim__c WHERE Insurance__c = :insurances[0].Id AND Type__c = 'Loss' LIMIT 1]; if (claims.size() <= 0) { Claim__c claim = new Claim__c(); claim.Insurance__c = insurances[0].Id; claim.Status__c = 'New'; claim.Contact__c = assets[0].ContactId; claim.Type__c = 'Loss'; claim.Asset__c = assets[0].Id; insert claim; Claim__c claimUpdated = [SELECT Id,Name FROM Claim__c WHERE Insurance__c = :insurances[0].Id AND Type__c = 'Loss' Order by CreatedDate DESC LIMIT 1 ]; return claimUpdated.Name; } else { return claims[0].Name + ' already filed.'; } } else { return 'No coverage. Asset status adjusted to Lost.'; } } //If the asset record is not found, return an error message. else { return 'No device found.'; } } } ---------------------------AssetServiceTest class------------------------------ @isTest private class AssetServiceTest { @isTest static void testReportLostDevice_assetNotFound() { // Call the method under test with a non-existent asset identifier Test.startTest(); String result = AssetService.reportLostDevice('NonExistentAsset'); Test.stopTest(); // Assertion System.assertEquals('No device found.', result, 'Expected error message for non-existent asset'); } @isTest static void testReportLostDevice_noInsuranceCoverage() { Account testAccount = new Account(Name='Test Account1'); insert testAccount; Contact testContact = new Contact(FirstName='Test2', LastName='Contact2', AccountId=testAccount.Id); insert testContact; // Create test data - asset with no insurance coverage Asset testAsset = new Asset(Name='Test Asset 2',AccountId =testAccount.Id,ContactId=testContact.id, Asset_Identifier__c='Asset002', Status='Available'); insert testAsset; // Call the method under test Test.startTest(); String result = AssetService.reportLostDevice(testAsset.Asset_Identifier__c); Test.stopTest(); // Assertion System.assertEquals('No coverage. Asset status adjusted to Lost.', result, 'Expected message for no insurance coverage'); } @isTest static void testReportLostDevice_claimAlreadyFiled() { Account testAccount = new Account(Name='Test Account2'); insert testAccount; Contact testContact = new Contact(FirstName='Test3', LastName='Contact3', AccountId=testAccount.Id); insert testContact; // Create test data - asset with insurance coverage and existing claim Asset testAsset = new Asset(Name='Test Asset 3',AccountId =testAccount.Id,ContactId=testContact.id, Asset_Identifier__c='Asset003', Status='Available'); insert testAsset; Insurance__c testInsurance = new Insurance__c(Asset__c=testAsset.Id, Coverage__c='Comprehensive', Active__c=true); insert testInsurance; // Call the method under test Test.startTest(); String result = AssetService.reportLostDevice(testAsset.Asset_Identifier__c); Test.stopTest(); List<Claim__c> claims = [SELECT Id,Name FROM Claim__c WHERE Insurance__c = :testInsurance.Id AND Type__c = 'Loss' LIMIT 1]; System.assertEquals(claims[0].Name, result, 'Expected message for already filed claim'); } }
@trailheadchallenge
@trailheadchallenge 22 күн бұрын
------------------------------------ProductZoningService apex class---------------------------------- @RestResource(urlMapping='/ProductZoning/*') global with sharing class ProductZoningService { @HttpGet global static String getPermissibleFlyZone() { RestRequest req = RestContext.request; RestResponse res = RestContext.response; String countryCode = req.headers.get('CountryCode'); if (String.isEmpty(countryCode)) { countryCode = 'US'; // Default to US if CountryCode header is not provided } // Retrieve product code from query parameters String productCode = req.params.get('ProductCode'); if (String.isEmpty(productCode)) { return 'ProductCode is missing or doesn\'t exist'; } List<Product2> products = [SELECT Family FROM Product2 WHERE ProductCode = :productCode LIMIT 1]; if (products.isEmpty()) { return 'ProductCode is missing or doesn\'t exist'; } Product2 product = products[0]; List<Product_Geo_Mapping__mdt> mappings = [ SELECT Permissible_Fly_Zone__c FROM Product_Geo_Mapping__mdt WHERE Product_Family__c = :product.Family AND Country_Code__c = :countryCode LIMIT 1 ]; if (!mappings.isEmpty()) { return mappings[0].Permissible_Fly_Zone__c; } else { return 'Confirm with the local authorities'; } } } -------------------------------ProductZoningServiceTest class--------------------------------------- @IsTest private class ProductZoningServiceTest { @TestSetup static void setup() { // Create Product Product2 product = new Product2(Name = 'Test Product', ProductCode = 'GC1020', Family = 'TestFamily'); insert product; } @IsTest static void testGetPermissibleFlyZone() { // Test with valid product code and country code RestRequest req = new RestRequest(); req.requestURI = '/services/apexrest/ProductZoning/'; req.addParameter('ProductCode', 'GC1020'); req.httpMethod = 'GET'; req.headers.put('CountryCode', 'US'); RestContext.request = req; RestContext.response = new RestResponse(); String response = ProductZoningService.getPermissibleFlyZone(); System.assertEquals('Confirm with the local authorities', response); // Test with valid product code and different country code req.headers.put('CountryCode', 'DE'); response = ProductZoningService.getPermissibleFlyZone(); System.assertEquals('Confirm with the local authorities', response); // Test with valid product code but country code not defined req.headers.put('CountryCode', 'FR'); response = ProductZoningService.getPermissibleFlyZone(); System.assertEquals('Confirm with the local authorities', response); // Test with missing product code req = new RestRequest(); req.requestURI = '/services/apexrest/ProductZoning/'; req.httpMethod = 'GET'; RestContext.request = req; response = ProductZoningService.getPermissibleFlyZone(); System.assertEquals('ProductCode is missing or doesn\'t exist', response); // Test with non-existent product code req = new RestRequest(); req.requestURI = '/services/apexrest/ProductZoning/'; req.addParameter('ProductCode', 'INVALID'); req.httpMethod = 'GET'; RestContext.request = req; response = ProductZoningService.getPermissibleFlyZone(); System.assertEquals('ProductCode is missing or doesn\'t exist', response); } }
@maheshd6291
@maheshd6291 24 күн бұрын
thanks
@madhunarasimha9508
@madhunarasimha9508 Ай бұрын
Getting error: Challenge Not yet complete... here's what's wrong: We can't find the Create Record element creating the task if the order has three or four books with the correct configuration. Make sure the element is on the correct decision path and the task fields are populated correctly.
@shambhavi.pandey
@shambhavi.pandey 20 күн бұрын
did u resolve it? am facing the same Hope you pls reply
@madhunarasimha9508
@madhunarasimha9508 20 күн бұрын
@shambhavi.pandey No, I'm unable to resolve it.
@sfdc-dz7qs
@sfdc-dz7qs 13 күн бұрын
@@madhunarasimha9508 r u still facing the issue as i have completed this challenge today itself!
@rinkalkulshrestha4647
@rinkalkulshrestha4647 Ай бұрын
Error Optimizer Schedule Not Changed Try again. I got this error pls help
@madhu.g3091
@madhu.g3091 Ай бұрын
Thank you❤
@MrEasyTriggerr
@MrEasyTriggerr Ай бұрын
I've followed the steps but I get an error at the end: Challenge Not yet complete... here's what's wrong: We couldn't find the Order linked to the Quote named 'Q-00015', with the correct address, Invoice Batch, non-zeroed Total Amount, and Tax Amount. Please make sure the record exists, it contains the correct values according to the requirements, and please try again.
@purusothamank8950
@purusothamank8950 Ай бұрын
Same Issue Faced, If Answer Find Please Send
@aditya-oh4gk
@aditya-oh4gk Ай бұрын
in my case Violet Maccleod and Initial Solar Purchase 5M data are not available.
@haripriyag668
@haripriyag668 Ай бұрын
Hi I'm getting an error at step 4 "Challenge Not yet complete.. here's what's wrong: We can't find the third approval step with the correct approver". I followed the same steps in the video. Can someone help me out?
@mennoegbers6625
@mennoegbers6625 Ай бұрын
So despite the criteria for the first step being Request Type "Bug" or "Data Load", you're simply ignoring that and it still passes inspection! WTF
@kavyand-g5f
@kavyand-g5f Ай бұрын
How did you get "Sum of" fields in the chart measure? should we create these summary fields?
@beenz8114
@beenz8114 Ай бұрын
I don't understand using hard ware sales opportunity?
@chintan_solanki
@chintan_solanki 2 ай бұрын
In Order Product, Solarbots Order Product Consumption Schedules and Usage Summaries are not being created. What could be the reason behind this ?
@trailheadchallenge
@trailheadchallenge 2 ай бұрын
Both Flow's Should active check the consumption schedule record should link to the solarbot product
@shrutisingh8892
@shrutisingh8892 Ай бұрын
@@trailheadchallenge Flow is active, consumption schedule record is linked to the solarbot product. Still not showing Solarbots Order Product Consumption Schedules and Usage Summaries. Please guide.
@nicoleinman2682
@nicoleinman2682 Ай бұрын
check your Salesforce CPQ installed package settings to make sure "Enable Usage Based Pricing" is checked as it allows consumption schedules to be created.
@trailheadchallenge
@trailheadchallenge Ай бұрын
I was face same issue, do one thing delete both consumption schedule record create again, If possible I will write one blog for the challenge no 16
@akarshagarwal995
@akarshagarwal995 2 ай бұрын
Does anyone have challenge 16 video or maybe if someone can help me out.
@trailheadchallenge
@trailheadchallenge Ай бұрын
now it's available in our channel.
@Truegamer863
@Truegamer863 2 ай бұрын
In lightning pages when click on boat record page showing No data for this object how fix it
@Reenakorejo-k7e
@Reenakorejo-k7e 2 ай бұрын
How to become a member in this group?
@trailheadchallenge
@trailheadchallenge Ай бұрын
just click on 'JOIN' Button
@amber87099
@amber87099 Ай бұрын
I don’t see the join option
@aqsabalochgaming6764
@aqsabalochgaming6764 2 ай бұрын
how to become member of this channel...anyone plz?
@trailheadchallenge
@trailheadchallenge Ай бұрын
click on Join button
@starboysasuke2461
@starboysasuke2461 2 ай бұрын
How to get that Brand Ambassadors filter for Contact object?
@starboysasuke2461
@starboysasuke2461 2 ай бұрын
The Logo is not available to me...
@buddhateja4423
@buddhateja4423 3 ай бұрын
I have this issue saying - Not yet complete... here's what's wrong: Whoops, looks like there was a problem. Please try again. While the other superbadges are working fine. I've tried clearing browser cache and things and also deleted the entire progress of the challenge yet still it is giving me the same error
@trial2-e6b
@trial2-e6b 3 ай бұрын
how do i solve this issue, please help -> Challenge Not yet complete... here's what's wrong: Whoops, looks like there was a problem. Please try again.
@veeramaniveeramani-w3r
@veeramaniveeramani-w3r 3 ай бұрын
Challenge Not yet complete... here's what's wrong: Whoops, looks like there was a problem. Please try again. please clear this error
@ManiPathiri
@ManiPathiri 3 ай бұрын
Same problem
@trial2-e6b
@trial2-e6b 3 ай бұрын
how did you resolve this issue? pls
@sudipsen3677
@sudipsen3677 3 ай бұрын
Thank you ❤
@RahulMandal-d9f
@RahulMandal-d9f 3 ай бұрын
Can anyone help i am getting this error when i am deploying the apex class BoatDataService === Component Failures [18] TYPE FILE NAME PROBLEM ───── ────────────────────────────────────────────────────────── ─────────────── ──────────────────────────────────────────────────────── Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Invalid type: Boat__c Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Invalid type: Boat__c Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Invalid type: BoatType__c Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Invalid type: BoatReview__c Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Illegal conversion from List<SObject> to List<Boat__c> Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Invalid type: Boat__c Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Invalid type: Boat__c Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Variable does not exist: parentBoat Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Variable does not exist: parentBoat Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Variable does not exist: parentBoat Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Variable does not exist: parentBoat Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Variable does not exist: parentBoat Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Variable does not exist: parentBoat Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Variable does not exist: parentBoat Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Invalid type: Schema.BoatType__c Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Invalid type: Schema.BoatReview__c Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService Invalid type: Boat__c Error sdx_sourceDeploy_1729498450790/classes/BoatDataService.cls BoatDataService DML requires SObject or SObject list type: List<Boat__c> TYPE PROJECT PATH PROBLEM ───── ────────────────────────────────────────────────── ──────────────────────────────────────────────────────────────── Error force-app/main/default/classes/BoatDataService.cls Invalid type: Boat__c (8:33) Error force-app/main/default/classes/BoatDataService.cls Invalid type: Boat__c (21:33) Error force-app/main/default/classes/BoatDataService.cls Invalid type: BoatType__c (68:37) Error force-app/main/default/classes/BoatDataService.cls Invalid type: BoatReview__c (73:39) Error force-app/main/default/classes/BoatDataService.cls Illegal conversion from List<SObject> to List<Boat__c> (17:9) Error force-app/main/default/classes/BoatDataService.cls Invalid type: Boat__c (22:9) Error force-app/main/default/classes/BoatDataService.cls Invalid type: Boat__c (24:9) Error force-app/main/default/classes/BoatDataService.cls Variable does not exist: parentBoat (28:13) Error force-app/main/default/classes/BoatDataService.cls Variable does not exist: parentBoat (33:31) Error force-app/main/default/classes/BoatDataService.cls Variable does not exist: parentBoat (39:36) Error force-app/main/default/classes/BoatDataService.cls Variable does not exist: parentBoat (40:36) Error force-app/main/default/classes/BoatDataService.cls Variable does not exist: parentBoat (49:35) Error force-app/main/default/classes/BoatDataService.cls Variable does not exist: parentBoat (50:35) Error force-app/main/default/classes/BoatDataService.cls Variable does not exist: parentBoat (59:37) Error force-app/main/default/classes/BoatDataService.cls Invalid type: Schema.BoatType__c (69:16) Error force-app/main/default/classes/BoatDataService.cls Invalid type: Schema.BoatReview__c (74:16) Error force-app/main/default/classes/BoatDataService.cls Invalid type: Boat__c (107:9) Error force-app/main/default/classes/BoatDataService.cls DML requires SObject or SObject list type: List<Boat__c> (112:9
@gamers-g4d
@gamers-g4d 2 ай бұрын
you got any solution
@peravaliramesh6705
@peravaliramesh6705 3 ай бұрын
Vertical bar chart is disabled in dashboard
@paulovogado5550
@paulovogado5550 3 ай бұрын
That was heavy!!Thank you!!!