- 7. Mai 2023
- Posted by:
- Category: Allgemein
LocaleSidKey=en_US, ProfileId = p.Id, 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 {. 0. At the Spine Wellness Center, we strive to continue to be leaders in our field with proficiency in the latest technology and best patient outcomes possible. insert newMRRecordList; List createdCases = [Select Id from Case where Type = Routine Maintenance]; id equipmentId = equipment.Id; System.debug(vehicleId+ +equipmentId); case somethingToUpdate = createMaintenanceRequest(vehicleId,equipmentId); Case newCase = new Case(); newCases.put(oneCase.Id, newRoutineCase); cas.Status = 'Closed'; to use Codespaces. SYSTEM.assertEquals(newReq.Vehicle__c, vehicleId); }. insert newEMIRecordList; Click Buttons, Links and Actions. document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); This site uses Akismet to reduce spam. if(Trigger.isInsert){ newMRRecordList.add(newMRRecord); Challenge 2 - WarehouseCalloutService.class If you like what I write and it has been ever helpful to you. } Salesforce Trailhead Superbadge 'Apex Specialist' Apex Specialist is one of the superbadges of Salesforce trailhead(A New Approach to Learning Salesforce). SYSTEM.assertEquals(newReq.ProductId, equipmentId); Making statements based on opinion; back them up with references or personal experience. If you don't get the complete picture of super badge, you can jot down the requirements and connect them (like a process flow diagram). @future, Http@futureAPI, @future callout true @future http.send 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) . Create trigger helper class MaintenanceRequestHelper, Create Test class MaintenanceRequestTest, you can find the complete code over the git repo [https://github.com/amitjpr/Thailhead-Solutions/tree/master/Superbadges/Apex]. } maintenanceNew.Vehicle__c = vehicle.Id; insert newEMIRecordList; Wait for a minute and run it twice maybe before checking challenges. Paste it below to help someone else looking. enter . Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Salesforce Interview Questions and Answers We Swear By! And I might not be the best to advice on that particular section. if (!mapCases.containsKey(oldCaseId)){ Challenge Not yet complete heres whats wrong: update requestList; public static Vehicle__c buildVehicle(){ newCase.Type=typeCase; 0. system.assert(allRequest.size() == 1); Modifications to the below Apex Classes as below. somethingToUpdate.status = CLOSED; leastValueMap.put(emi.Maintenance_Request__c,emi); So glad you cared to share this. Please go threw the carefully , you will understand both . List lista = [ }. newProducts.add(pr); Set setIdCases = new Set(); for(Integer i_fail = 0; i_fail < 300; i_fail ++){ // ToDo: Call MaintenanceRequestHelper.updateWorkOrders }. } Map caseKeys = new Map (CaseIDs); } I have Class name MaintenanceRequestHelper and i am adding it but still it not accepting this getting below error. public with sharing class MaintenanceRequestHelperTest {. Read more about our practice and the latest advances in the field of orthopedics. Thanks for this post! 0. . update caseToUpdate; maintenanceNew.ContactId = contact.Id; newCases.put(oneCase.Id, newRoutineCase); Browse other questions tagged. Test.startTest(); emiListToBeUpdated.add(e); public static void setupTest(){ @isTest ), Press J to jump to the feed. Connecticut State Medical Society Can you still use Commanders Strike if the only attack available to forego is an attack against an ally? See terms and privacy here. It should work. List caseToUpdate = new List(); newMRRecord.Date_Reported__c=date.today(); I highly doubt the entire quest would have changed. Level Up with Salesforce and Win Free Certificate voucher! newItems.add(i1); System.enqueueJob(New WarehouseCalloutService()); apex specialist superbadge challenge 5; apex specialist superbadge challenge 5. List EquipmentIDListUpdate = new List(); Most of the other answers I found online also keep pointing to this Equipment__c field, which doesnt exist. id equipmentId = equipment.Id; System.debug(vehicleId+ +equipmentId); case somethingToUpdate = createMaintenanceRequest(vehicleId,equipmentId); Laendor code is not working. Modified 2 months ago. Vehicle__C vehicle = createVehicle(); Apologies for the codes have changed. } Go to Setup > Apex Classes > Schedule a job like below: Edit the following in the Developer console. } private static final string STATUS_NEW = New; Set oldIdCases = newCases.keySet(); newCase.Comments = New comment!; Test.startTest(); I dont see why there would be a Equipment__c lookup established with the Maintenance Request (Case) Object here, since the ERD clearly shows that the link is with the Equipment Maintenance Item Object (which can be found in the related list). Hey Haja. Is there a specific import order? Please create a seperate trailhead playground for each superbadge challenge. for(Case MRRecord: newList){ Map
Black Doctors In West Palm Beach,
Vegetarian Sausages Tesco,
How Many Surfers Have Died At Jaws,
Mcchicken Biscuit Discontinued,
Articles A