mapCases.put(oldCaseId,new List()); Apex Specialist Superbadge Trailmix | Salesforce Trailhead Laura Thomas +19,700 Points +1,000 points Module Apex Triggers Write Apex triggers to perform custom database actions. Review the data schema in your modified Salesforce org as you read the detailed requirements below. private static final string REPAIR = Repair; And I might not be the best to advice on that particular section. if(MRRecord.Status!= oldMap.get(MRRecord.ID).Status && MRRecord.Status == Closed && (MRRecord.Type==Repair || MRRecord.Type==Routine Maintenance)){ where Maintenance_Request__c in: oldRequestIds]; system.assert(allRequests.size() == 300); update caseToUpdate; }, public static void updateNewMaintenanceRequest(List newList){ So glad you cared to share this. e.Equipment__c = emis.Equipment__c; public static Vehicle__c buildVehicle(){ @istest I'm working on the Apex Specialist super badge on the Salesforce Trailhead. for(Case MRRecord: newList){ But i will surely get back to you on this. Mock, Please edit your answer to include an explanation of your code. newEMIRecord.Equipment__c=EMIRecord.Equipment__c; Process Automation Specialist step 7 no work. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Test.startTest(); Equipment_Maintenance_Item__c i1 = buildItem(newCases[i_ok].Id, equipment.Id); } Hi @Edgar Moran, Can you please send me complete code of this "Unlock the Apex Specialist Superbadge". } Synchronize Salesforce data with an external system using asynchronous REST callouts. if(MRRecord.Vehicle__c==EMIRecord.Maintenance_Request__r.Vehicle__c){ MaintenanceRequestTest.CreateData( 5,2,2,Repair); Apex SpecialistSuperbadge,Challenge-1 : Automate Record Creation,Challenge-2 : Synchronize Salesforce data with an external system. Thanks for letting know. Apex @future from Case } I will try and review that shortly and update the required. Hope it helps, find it at the bottom of the website or search site name on telegram. Connect and share knowledge within a single location that is structured and easy to search. }. for(Equipment_Maintenance_Item__c EMIRecord: EMIList){ }, if(Trigger.isAfter){ im geting error, Currently there arent any specific certification related to health cloud. This is the message I get: insert newCaseList; emiListToNewCase = [Select id,name,Maintenance_Request__c,Equipment__r.Maintenance_Cycle__c from Equipment_Maintenance_Item__c where Maintenance_Request__c IN: oldNewCaseMap.keySet()]; for(Equipment_Maintenance_Item__c emis : emiListToNewCase){ from case Advanced Apex Specialist Superbadge - Step 3 Issue . for(Equipment_Maintenance_Item__c emi : emiList){ Step 1 Go through the Apex Specialist Use-Case,Business Requirement And Schema Diagram of the Story, Step 2 -Create a New Trail Head Playground so That there will not be any Problem while Going through the apex code, Step 3 -To Start the apex challenge Install this unmanaged package after that go through the Standard object and the custom object details in your org so that you might get understand the basic of the Requirement, Step 4 you all have the apex class made while installing unmanaged package, a. Update the following below code in the MaintenanceRequest trigger, trigger MaintenanceRequest on Case (before update, after update) {, // call MaintenanceRequestHelper.updateWorkOrders. Hi, Trails. GROUP BY Maintenance_Request__r.ID ]; If nothing happens, download GitHub Desktop and try again. cas.Type = 'Repair'; newVehicle.Name = Dummy Vehicle; public static Product2 buildEquipment(){ newCase.Origin=web; I ll look into it and get back to you shortly. Hey itachi, try debugging the code and look where the issue is. As bejng the solo running admin to this page i might not be able to update the solutions on short notice. maintenanceNew.ProductId = product.Id; newCases.add(newCase); Profile p = [SELECT Id FROM Profile WHERE Name=Standard User]; Start a discussion in the forum to get straight-up answers. if(MRRecord.Type==Routine Maintenance){ } Tips3, PlaygroundTrailhead Reports & Dashboards Specialist . update somethingToUpdate; Case newReq = [Select id, subject, type, Date_Reported__c, Vehicle__c, Date_Due__c mukesh gupta. for(AggregateResult res :wpc){ return equipment; newDate = Date.today()+result.get(oneCase.Id); } ChangethelabelsforStandard Objectsand Fields in SalesforceGo to Setup -> Customize -> Tab Names andLabels->RenameTabs andLabels. Please With that being said, it seems like you need more understanding of the apex coding language in general. insert newCases; newItems = new List(); system.debug(EMIList +EMIList); Stuck on Superbadge Apex Specialist Step 4? Salesforce, Trailhead, superbadge Code shared by Laendor is not working. }, Challenge 2 : Synchronize Salesforce data with an external system Salesforce Consultant || 6X Certified Salesforce || 1X DevOps Certified || TrailheadRanger || Salesforce Lover || Follow me at https://shivshankarsfdc.com/, Automate record creation using Apex triggers, Synchronize Salesforce data with an external system using asynchronous REST callouts, Test automation logic to confirm Apex trigger side effects, Test integration logic using callout mocks. There was a problem preparing your codespace, please try again. Hi the challenge has been updated. Product2 product = [SELECT Id, Name, isActive, Maintenance_Cycle__c, Replacement_Part__c FROM Product2 WHERE Name = test LIMIT 1]; for(Integer i=1;i<=1000;i++){ } Set setIdCases = new Set(); Can you please help me out, I am also getting the same error. insert emiListToBeUpdated; Test scheduling logic to confirm action gets queued. e.Maintenance_Request__c = oldNewCaseMap.get(emis.Maintenance_Request__c).Id; , Apex, ApexHttpCalloutMock , hi, martand please lemme know if it is verified, I ll update the same! https://salesforce.stackexchange.com/questions/336871/apex-specialist-challenge-1-productid-null/341363#341363. case cs = new case(Type=REPAIR, Challenge Not yet complete heres whats wrong: } If multiple equipments are used in the maintenance request, choose the shortest maintenance cycle to define the service date. private static final string REQUEST_TYPE = Routine Maintenance; This is the message I get: I was able to solve it, when trailhead runs the testing is doing a count query to Cases based on the Subject, I didn't put the subject when the case is created as new. If you're if that type, you can read the apex developer documentation. Vehicle__c vehicle = createVehicle(); pr.Warehouse_SKU__c = (String)productMap.get(sku); } It did not work for me. Save my name, email, and website in this browser for the next time I comment. im stuck in challenge 4. request.setEndpoint(WAREHOUSE_URL); I am unaware of any changes. This was my last superbadge and by completing thisAdvanced Apex Specialist Superbadge, I became eligible forPlatform Developer II certificate. vehicleList.add(createVehicle()); maintenanceNew.Product__c = product.Id; A tag already exists with the provided branch name. Trailhead Hope this helps. Learn directly from Salesforce experts. from case]; Equipment_Maintenance_Item__c workPart = [select id } newCases.put(oneCase.Id, newRoutineCase); Maintenance_Request__c = requestId); Asking for help, clarification, or responding to other answers. maintenanceNew.ContactId = contact.Id; Concepts tested in this superbadge include: Apex Triggers . Challenge Not yet complete heres whats wrong: Do lemme know if you find solutions codes that work well for it. Set caseIdSet = new Set(); Map oldNewCaseMap = new Map(); Stuck on Superbadge Apex Specialist Step 1? newMRRecord.Type=Routine Maintenance; }. public with sharing class WarehouseCalloutService implements queueable, Database.AllowsCallouts {. test.stopTest(); list allRequest = [select id what objects I have to make all those things..Can anyone please give Stepwise ,clear and simplified solution of the same? id vehicleId = vehicle.Id; product2 equipment = createEq(); newMRRecord.Subject=Routine CheckUp + date.today(); Viewed 5k times . where status =: STATUS_NEW]; list workParts = [select id }. check if u have creted a process builder , i did create a proces builder and deactivated and it worked for me. insert workP; test.startTest(); system.assertEquals(newReq.Type, REQUEST_TYPE); For Challenge 1 I am getting error for some of the fields that they doesnt exist like Vehicle__c, Equipment__c, Due_Date__c. Paste it below to help someone else looking. I used this code for MaintenanceRequestHelper: public with sharing class MaintenanceRequestHelper {. Status=STATUS_NEW, } to use Codespaces. Please Guide me.. newCase.Date_Due__c = todayDate.addDays(numberOfDays); Case newCase = buildCase(vehicle.Id,'Electrical','DummyFAIL_'+i_fail); Find centralized, trusted content and collaborate around the technologies you use most. How can we prove that the supernatural or paranormal doesn't exist? Learn. This repository is for solving all the problems in the way of earning this superbadge. newCase.Vehicle__c=vehicleId; @future(callout=true)public static void runWarehouseEquipmentSync(){, if(response.getStatusCode()==200){//System.debug(size of equipment +equipmentlist.size());List updateEquipmentlist=getProductlist(response);if(updateEquipmentlist.size() > 0){insert new List(updateEquipmentlist);}}}, public static List getProductlist(HttpResponse response){, List