Modified 2 months ago. Making statements based on opinion; back them up with references or personal experience. insert workP; test.startTest(); newItem.Maintenance_Request__c = newCase.Id; listEquipmentMaintenanceItem.add(newItem); Hot Network Questions Applications of super-mathematics to non-super mathematics Resistance against timing attacks of AES candidates How to deal with Hostile Work Environment after attending Employee Workshop The region and polygon don't match. } System.debug(*** Updated cases: +caseToUpdate.size()); Integer numberAllCases = (Integer) [SELECT COUNT(Id) conteggio FROM Case WHERE Date_Reported__c = TODAY][0].get(conteggio); if(!EquipmentIDListUpdate.contains(EMIRecord.Equipment__c)){ for(Id oldId : oldIdCases){ newItems.add(i1); newMRRecord.Vehicle__c = MRRecord.Vehicle__c; Trailheads are good for general understanding of a concept whereas the super badge is a test of that concept in a scenario. Stuck on Superbadge Apex Specialist Step 6? return cs; rev2023.3.3.43278. what objects I have to make all those things..Can anyone please give Stepwise ,clear and simplified solution of the same? ( Automate record creation ), I face this error what can I do please Help me. Case newCase = new Case(); } HttpRequest request = new HttpRequest(); CronTrigger is similar to a cron job on UNIX systems. contact.AccountId = acc.Id; // Sync with Warehouse upsert newProducts; }. If u further need help you can join the telegram group from link on the homepage. List emiListToNewCase = new List(); Also search for blogs, articles regarding it. Test.stopTest(); Please help! Would have to get back to you. for(case req : requestList){ EquipmentIDListUpdate.add(EMIRecord.Equipment__c); newCase.Date_Due__c=Date.today(); public static Equipment_Maintenance_Item__c buildItem(Id caseId, Id equipmentId){ insert emptyReq; Equipment_Maintenance_Item__c workP = createWorkPart(equipmentId, emptyReq.Id); APEX. I have complete Idea of this coding bt I am not getting what to do before writing this code exactly for this challenge. Hi @Edgar Moran, Can you please send me complete code of this "Unlock the Apex Specialist Superbadge". Equipment_Maintenance_Item__c newEMIRecord = new Equipment_Maintenance_Item__c(); if(newMRRecordList.size()>0){ Hey pratap! private static final string REQUEST_TYPE = Routine Maintenance; newCase.Date_Reported__c=Date.today(); product.Name = test; public static void testNegative(){ } Case maintenanceNew = new Case(); I'm working on the Apex Specialist super badge on the Salesforce Trailhead. private static void testMaintenanceRequestNegative(){ newMRRecord.Type=Routine Maintenance; Hard times, Challenge 1 : Automate record creation Can you please help me out, I am also getting the same error. Please note that I also have separate method to cover positive and negative scenarios. Integer numberOfDays = Integer.valueOf(leastValueMap.get(c.Id).Equipment__r.Maintenance_Cycle__c); } How can we prove that the supernatural or paranormal doesn't exist? } } Create an account to follow your favorite communities and start taking part in conversations. Home. public with sharing class WarehouseCalloutService implements queueable, Database.AllowsCallouts {. List newRoutineMaintenanceVehicleRecordIDList = new List(); insert acc; Contact contact = new Contact(); Hi Admin, following up on this comment. maintenanceNew.AccountId = acc.Id; Vehicle__c newVehicle = new Vehicle__c(); insert workP; test.startTest(); Its a pretty long post that i wrote quiet long time back. Use the included package content to . newItem.Quantity__c = item.Quantity__c; My Blog explains about the steps for completing this super badge. This code works perfectly fine for Challenge 1. newEMIRecord.Equipment__c=EMIRecord.Equipment__c; } Create your own notes with your understanding and you can ask a senior at work to review them for you. newCase.Vehicle__c=vehicleId; Map productMap = (Map) p; We have a small group to help out each others. e.Maintenance_Request__c = oldNewCaseMap.get(emis.Maintenance_Request__c).Id; Do I need to do some prep work. for(Integer i_fail = 0; i_fail < 300; i_fail ++){ A tag already exists with the provided branch name. If you don't see your @future method in the list, then there's something wrong, but if you . private static final string WORKING = Working; Hey harsh. You should definitely complete the task on your own and you can get all the help. 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 {. else if(leastValueMap.containsKey(emi.Maintenance_Request__c) && emi.Equipment__r.Maintenance_Cycle__c < leastValueMap.get(emi.Maintenance_Request__c).Equipment__r.Maintenance_Cycle__c){ Save my name, email, and website in this browser for the next time I comment. insert equipmentList; for(integer i = 0; i < 300; i++){ insert requestList; for(integer i = 0; i < 300; i++){ This is an unofficial (no salesforce sponsorship) forum to discuss getting certified and building on salesforce platforms (force.com, heroku, exacttarget, slack, etc. test.stopTest(); list allRequest = [select id hi, martand please lemme know if it is verified, I ll update the same! I think everyone has given awesome suggestions , I'll try to add some more insights -. ProductId=equipmentId, { newVehicle.Name = Dummy Vehicle; public static Product2 buildEquipment(){ to use Codespaces. which certification i should do to expertise myself in that domain, Hi there Neha ! @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