sign in Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. newCase.Date_Due__c=newDate; private static void linkEquipmentsToNewCases( private static final String WAREHOUSE_URL = https://th-superbadge-apex.herokuapp.com/equipment'; // complete this method to make the callout (using @future) to the// REST endpoint and update equipment on hand. Follow guided learning paths. if(!newRoutineMaintenanceVehicleRecordIDList.contains(MRRecord.Vehicle__c)) Map vehicleToEquipmentMap = new Map(); I had cleared this superbadge way back in time would have to seriously redo it to understand what was done on this one. The author also has a YouTube channel that goes over key concepts which may be helpful: SFDC YouTube Channel Best of luck! $ sfdx force:source:retrieve -n NameOfThePackage This will retrieve all the components in the package into a new folder named as the package. } List EquipmentIDListUpdate = new List(); 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. Origin=REQUEST_ORIGIN, Product needs to be renamed as Equipment not Vehicle since Vehicle is already provided to us in the installed package. Could you please point out the specifics. Issue with Superbadge Apex Specialist Step 5? Continuing my quest with trailhead#SeizetheTrail , the last one in my list is theAdvanced Apex Specialist Superbadge. MaintenanceRequestHelper.createNewEquipmentMaintenanceItem(Trigger.newMap); public class Constants { public static final Integer DEFAULT_ROWS = 5; public static final String SELECT_ONE = Label.Select_One; public static final String INVENTORY_LEVEL_LOW = Label.Inventory_Level_Low; public static final List<Schema.PicklistEntry . }. Apex Specialist Challenge 1 too Many DML Rows. Choose the Tab (orObject) you want torenameand clickEdit. caseToUpdate.add(newCase); If you're if that type, you can read the apex developer documentation. https://salesforce.quip.com/gJ3QAkFy6boE, Apex SpecialistApexMockApex centerfold boy girl gallerycara membaca heatmapjava print libraryNot when Mom says I have to go inside Keep on trying, and you can finish this badge! ), Press J to jump to the feed. MaintenanceRequestTest.CreateData( 5,2,2,Repair); Case newCase = mapOldCasesWithNewCases.get(idOld); Test.startTest(); Map productMap = (Map) p; For any superbadge, you will have to install a package before starting. } Also various YouTube videos and blogs exist. Apex Code Development (89731) General Development (54672) Visualforce Development (37117) Lightning (17463) APIs and Integration (16704) Trailhead (11575) Formulas & Validation Rules Discussion (11140) Other Salesforce Applications (7994) . This code works perfectly fine for Challenge 1. Level Up with Salesforce and Win Free Certificate voucher! Lightning Experience Specialist Closing a Maintenance Request of type 'Routine Maintenance' or 'Repair' did not create of a new Maintenance Request with the correct due date. Here is the code for bulk scenario testing which worked for me. Is it a bug? Now Update the below code in HelperClass MaintenanceRequestHelper, public static void updateWorkOrders(){// update workorders//bulk determineList maintenanceRequestList=[select id,case.Vehicle__c,Equipment__c,Equipment__r.Maintenance_Cycle__c,Type,Status from case where id in :Trigger.New limit 200];if(maintenanceRequestList !=null && maintenanceRequestList.size()>0 ){List insertMaintenanceRequest=getCaseList(maintenanceRequestList);insert insertMaintenanceRequest;}}, public static List getCaseList(List maintenanceRequestList){List newMaintenanceRequestList= new List();for(Case cas:maintenanceRequestList){if(cas.Type==Routine Maintenance && cas.Status==Closed){case newMaintenanceRequest=new Case();newMaintenanceRequest.Subject=test;newMaintenanceRequest.Type=Routine Maintenance;newMaintenanceRequest.Vehicle__c=cas.Vehicle__c;newMaintenanceRequest.Equipment__c=cas.Equipment__c;newMaintenanceRequest.Date_Reported__c=date.Today();newMaintenanceRequest.Date_Due__c=Date.today().addDays(Integer.valueOf(cas.Equipment__r.Maintenance_Cycle__c));newMaintenanceRequest.Status=New;newMaintenanceRequest.Origin=Phone;newMaintenanceRequestList.add(newMaintenanceRequest);}}return newMaintenanceRequestList;}}, 2: Synchronize Salesforce data with an external system, public with sharing class WarehouseCalloutService {. acc.Name = test; I am working on "Advanced Apex Specialist" Superbadge but I am not able to pass challenge 1 as it keeps on showing me that Select one label is not created. for(Case MRRecord: newMap.values()){ Hey nelson..Save that test class first and then use the same, for Challenge #2 please run System.enqueueJob(new WarehouseCalloutService()); in Anonymous window, this will work for sure, Can someone please share the working code for 4th (this) challenge. Set setIdCases = new Set(); insert vehicle; (I have already renamed Case and Product objects) to use Codespaces. } Viewed 5k times . Hey Nikhil. Status=STATUS_NEW, maintenanceNew.Date_Due__c = Date.today(); caseList.add(maintenanceNew); Go to Setup > Apex Classes > Schedule a job like below: Edit the following in the Developer console. Thanks again for pointing it out. } List newEMIRecordList = new List(); If you are facing any hurdles to complete the challenge, just go through the code. Hi, Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. How to react to a students panic attack in an oral exam? addDays+=daysToAdd; upsert newProducts; check if u have creted a process builder , i did create a proces builder and deactivated and it worked for me. Actions to Earn This Superbadge Automate record creation using Apex triggers newEMIRecord.Maintenance_Request__c=MRRecord.ID; Tips, ApexWeb APIApexDML1, Trigger.new sObject List This superbadges require a bit of practical experience in apex and all of them are not available on trailhead. If it works its . maintenanceNew.Product__c = product.Id; Apex Specialist is one of the superbadges of Salesforce trailhead(A New Approach to Learning Salesforce). How Intuit democratizes AI development across teams through reusability. Use Git or checkout with SVN using the web URL. Vehicle__c vehicle = buildVehicle(); MRRecord.Date_Due__c=MRRecord.Date_Due__c + integer.valueOf(maintenanceCycle); Thank you for this solution! Is there a proper earth ground point in this switch box? This repository is for solving all the problems in the way of earning this superbadge. Asking for help, clarification, or responding to other answers. It looks good on a resume to be a contributor. newItem.Quantity__c = 10; Hi @Edgar Moran, Can you please send me complete code of this "Unlock the Apex Specialist Superbadge". Trailhead solution for Apex Specialist superbadge Challenge 1 - MaintenanceRequest.trigger and MaintenanceRequestHelper.class Challenge 2 - WarehouseCalloutService.class Challenge 3 - WarehouseSyncSchedule.class Challenge 4 - MaintenanceHelperTest.class Challenge 5 - WarehouseCalloutServiceMock.class and WarehouseCalloutServiceTest.class e.Equipment__c = emis.Equipment__c; Test.stopTest(); Retry the process aforementioned. Method does not exist or incorrect signature: void CreateData(Integer, Integer, Integer, String) from the type MaintenanceRequestHelper. Honestly, I suggest reviewing the trailheads leading up to the apex super badge since the apex specialist Superbadge tests you on those core concepts. e.Maintenance_Request__c = oldNewCaseMap.get(emis.Maintenance_Request__c).Id; from Equipment_Maintenance_Item__c insert contact; Vehicle__c vehicle = new Vehicle__c(); But I have created it as you can see in below image. return wp; } request.setMethod(GET); document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); Ever loved someone so much, you would do anything for them? ~1 hr 30 mins +1,500 points Module Apex Testing Write robust code by executing Apex unit tests. for(Integer i_ok = 0; i_ok < 300; i_ok ++){ newRoutineMaintenanceVehicleRecordIDList.add(MRRecord.Vehicle__c); Connect on telegram if you again face a similar issue, Hi jaffer. product2 equipment = new product2(name = SuperEquipment, } Please provide additional details in your answer. system.debug(newEMIRecordList.size() +newEMIRecordList.size()); 'Apex Specialist' is one of the superbadges of Salesforce trailhead(A New Approach to Learning Salesforce). List createdCases = [Select Id from Case where Type = Routine Maintenance]; } If you don't see your @future method in the list, then there's something wrong, but if you . }. if(res.get(cycle)!=null){ maintenanceNew.ProductId = product.Id; Equipment_Maintenance_Item__c i1 = buildItem(newCases[i_ok].Id, equipment.Id); It should work. You should definitely complete the task on your own and you can get all the help. }. Advanced-Apex-Specialist-Salesforce-Super-Badge. @future, Http@futureAPI, @future callout true @future http.send If multiple equipments are used in the maintenance request, choose the shortest maintenance cycle to define the service date. private static final string WORKING = Working; public static void testNegative(){ rev2023.3.3.43278. They do give you a template and a requirements sheet. Connect and share knowledge within a single location that is structured and easy to search. newCase.Origin=web; public static Vehicle__c buildVehicle(){ Case newMRRecord = new Case(); insert tmpCases; public static Map getDueDate(List CaseIDs) { secondList.add(cas); System.assertEquals(1000,createdCases.size()); Need help for Challenge 4- can some one help me pls. Hi, 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. @isTest I tried to use your code as it is and it gives error..For this superbadge I already read on 7th Dec that Superbadge challenge will be changed on 9th Dec and I am unaware about old superbadge so cant tell you what actual changes are. 3 Answers. contact.LastName = last; Case newCase = buildCase(vehicle.Id,'Repair','DummyOK_'+i_ok); List newRoutineMaintenanceVehicleRecordIDList = new List(); If nothing happens, download Xcode and try again. System.debug(*** Total cases (expected 600): +numberAllCases); Test automation logic || Apex Specialist Superbadge Education Org's 273 subscribers Subscribe 23 Share 6.4K views 6 months ago Apex Specialist - Superbadge This is Apex Specialist Superbadge. Create your own notes with your understanding and you can ask a senior at work to review them for you. newRoutineMaintenanceVehicleRecordIDList.add(MRRecord.Vehicle__c); So glad you cared to share this. if((oneCase.status==closed) && (oneCase.type==Repair || oneCase.type==Routine Maintenance)) { trigger MaintenanceRequest on Case (before update, after update, before insert, after insert) { Stuck on Superbadge Apex Specialist Step 4? newEMIRecord.Maintenance_Request__c=MRRecord.ID; newCase.Date_Due__c = todayDate.addDays(numberOfDays); If you are facing any hurdles to complete the challenge, just go through the code. newMRRecord.Vehicle__c = MRRecord.Vehicle__c; oldNewCaseMap.put(c.Id,newCase); Can anyone explain me how getDueDate() function is defined under class: MaintenanceRequestHelper? Trailhead Academy. I had posted these at the time i completed them. newItem.Maintenance_Request__c = caseId; id equipmentId = equipment.Id; case emptyReq = createMaintenanceRequest(vehicleId,equipmentId);