GitHub - minicruiser/Apex-Specialist-Superbadge minicruiser / Apex-Specialist-Superbadge Public Notifications 13 Star Code Issues main 1 branch 0 tags Go to file Code minicruiser Update MaintenanceRequestHelper.cls 8b195dd on Jun 6, 2022 14 commits step2 Automate record creation Update MaintenanceRequestHelper.cls 8 months ago newEMIRecord.Maintenance_Request__c=MRRecord.ID; if(maintenanceCycle==0){ Thank you for this solution! Apex SpecialistSuperbadge,Challenge-1 : Automate Record Creation,Challenge-2 : Synchronize Salesforce data with an external system. If you don't see your @future method in the list, then there's something wrong, but if you . List newRoutineMaintenanceVehicleRecordIDList = new List(); vehicleToEquipmentMap.put(MRRecord.Vehicle__c,EquipmentIDListUpdate); This repository is for solving all the problems and pass all the challenges in the way of earning this superbadge. request.setMethod(GET); newEquipment.Maintenance_Cycle__c = 10; newMRRecord.Vehicle__c = MRRecord.Vehicle__c; Home. Create and follow custom learning playlists. You signed in with another tab or window. else{ Learn in-demand skills. for(Equipment_Maintenance_Item__c item: lista){ Automate record creation | Apex Specialist | Salesforce - YouTube 0:00 / 8:46 Automate record creation | Apex Specialist | Salesforce wonder studies 5.79K subscribers Subscribe 517 Share. LocaleSidKey=en_US, ProfileId = p.Id, Integer daysToAdd = Integer.valueOf(res.get(cycle)); for(Integer i_ok = 0; i_ok < 300; i_ok ++){ 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. document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); Ever loved someone so much, you would do anything for them? I highly doubt the entire quest would have changed. Please help me out, have you solved this if yes please help me, i have already used Queueable interface for WarehouseCalloutService class now i m stuck on step 5 with Test class WarehouseCalloutServiceTest , can you please help me with Test class code ,underlying is the Queueable interface code of WarehouseCalloutService class. } A tag already exists with the provided branch name. if(Trigger.isInsert){ newItem.Maintenance_Request__c = newCase.Id; listEquipmentMaintenanceItem.add(newItem); req.Status = CLOSED; where status =: STATUS_NEW]; list workParts = [select id Account acc = new Account(); And i aint plan to do those again anytime sooner as well. insert workPartList; test.startTest(); Salesforce Trailhead Superbadge: Apex Specialist Solution Challenge 1: Automate record creation STEP 1: Create a new Trailhead Playground Install the unmanaged Package Rename Case to Maintenance Request and Product to Equipment STEP 2: Automate record creation using Apex Trigger Update the trigger MaintenanceRequest: emptyReq.Status = WORKING; Search for an answer or ask a question of the zone or Customer Support. When this Superbadge came up, I identified several resources online that helped walk me through it. @isTest contact.AccountId = acc.Id; to use Codespaces. Closing a Maintenance Request of type Routine Maintenance did not create of a new . TrailheadSalesforce case cs = new case(Type=REPAIR, If nothing happens, download Xcode and try again. https://techevangel.com/2018/06/01/superbadge-advanced-apex-specialist/. Trailblazer CommunityTrailhead, ApexSalesforce Developer, Trailhead vol2. } Is it a bug? from Equipment_Maintenance_Item__c } If you have just one and a half months experience in Salesforce, apex specialist is a little too early now. Laendor code is not working. Hi Shaid, Please use below code:-. FROM Equipment_Maintenance_Item__c if(!leastValueMap.containsKey(emi.Maintenance_Request__c)){ if (!mapCases.containsKey(oldCaseId)){ Go to Setup > Apex Classes > Schedule a job like below: Edit the following in the Developer console. } How Intuit democratizes AI development across teams through reusability. return wp; Stuck on Superbadge Apex Specialist Step 1? newCases.add(newCase); insert newMRRecordList; , Apex, ApexHttpCalloutMock Status=STATUS_NEW, Apex Specialist Superbadge. test.stopTest(); list allRequest = [select id Do I need to do some prep work. TimeZoneSidKey=America/Los_Angeles, UserName=stdtest@testorg.com); List caseList = new List(); Case newCase = mapOldCasesWithNewCases.get(idOld); @isTest I worked through the Exam Prep guidelines. @future Connect and share knowledge within a single location that is structured and easy to search. I am unaware of any changes. ChangethelabelsforStandard Objectsand Fields in SalesforceGo to Setup -> Customize -> Tab Names andLabels->RenameTabs andLabels. Honestly, I suggest reviewing the trailheads leading up to the apex super badge since the apex specialist Superbadge tests you on those core concepts. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. upsert newProducts; } id vehicleId = vehicle.Id; Product2 equipment = createEq(); Invalid type: Schema.Work_Part__c, Use variable as ProductId instaed of Equipment__c Discover your ideal career. Schedule synchronization using Apex code. Trailhead solution for Apex Specialist superbadge. Decimal maintenanceCycle = 0; SELECT Id, Maintenance_Request__c, Equipment__c , Quantity__c I've successfully create a . There was a problem preparing your codespace, please try again. A tag already exists with the provided branch name. same error for me too.. can you please help me out, hi Map mapOldCasesWithItems = getItemsInOldCases(caseList); LWC Superbadge Step 3 - Setup / Clarification. from Equipment_Maintenance_Item__c }, Its not optimized but it gives me 500 points, and it is good! Learn. How can we prove that the supernatural or paranormal doesn't exist? $ sfdx force:source:retrieve -n NameOfThePackage This will retrieve all the components in the package into a new folder named as the package. Do we need to create this lookup relationship between Maintenance Request (Case) and Equipment (Product)? Apex specialist superbadge challenge 4. maintenanceNew.Vehicle__c = vehicle.Id; equipmentList.add(createEq()); REST APICall ApexSOQL100, Apex List secondList = new List(); Account acc = [SELECT Id, Name FROM Account WHERE Name = test LIMIT 1]; // ToDo: Call MaintenanceRequestHelper.updateWorkOrders }. newMRRecord.Date_Due__c=date.today(); newVehicle.Name = Dummy Vehicle; public static Product2 buildEquipment(){ 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. CronTrigger is similar to a cron job on UNIX systems. https://developer.salesforce.com/docs/atlas.ja-jp.apexcode.meta/apexcode/apex_scheduler.htm, ApexGUISchedulable Apex, [] [] [Apex] Apex , GUISalesforce For that, I would suggest the following udemy course: Salesforce Development Course. As it's currently written, it's hard to understand your solution. Equipment_Maintenance_Item__c e = new Equipment_Maintenance_Item__c(); newItem.Equipment__c = equipmentId; @TestSetup newCase.Vehicle__c=vehicleId; Apex Specialist. }, PRIVATE STATIC Case createMaintenanceRequest(id vehicleId, id equipmentId){ insert product; Skip to content. } Almost every step has assistance posted on the Salesforce Developer and Trailblazers forums. }, private static Map getItemsInOldCases(List caseList){ EquipmentIDListUpdate.add(EMIRecord.Equipment__c); Viewed 5k times . newCase.Status=New; cas.Type = 'Repair'; Challenge Not yet complete heres whats wrong: Map mapOldCasesWithNewCases = createNewCases(caseList); linkEquipmentsToNewCases(mapOldCasesWithItems,mapOldCasesWithNewCases); I had posted these at the time i completed them. I'm also trying to get more comfortable with Visual Studio Code with the Salesforce extensions. Currently there arent any specific certification related to health cloud. Actions to Earn This Superbadge Automate record creation using Apex triggers Test.startTest(); A tag already exists with the provided branch name. Tips3, PlaygroundTrailhead Reports & Dashboards Specialist . for(Case MRRecord: newMap.values()){ It looks good on a resume to be a contributor. I started working on this superbadge and this post is to document some of the findings / tips / gotchas as I progress through this one. Case newCase = new Case(); 1. Challenge 3 - WarehouseSyncSchedule.class 3 Answers. If you like what I write and it has been ever helpful to you. Do lemme know if you find solutions codes that work well for it. replacement_part__c = true); Challenge 5 - WarehouseCalloutServiceMock.class and WarehouseCalloutServiceTest.class They do give you a template and a requirements sheet. if(MRRecord.Vehicle__c==EMIRecord.Maintenance_Request__r.Vehicle__c){ Date todayDate = System.today(); The challenge is expecting the due date to be calculated using the maintenance cycle defined on the related equipment records. insert equipment; List newCases = new List(); insert vehicle; Product2 product = new Product2(); system.assert(newReq.Subject != null); I have Class name MaintenanceRequestHelper and i am adding it but still it not accepting this getting below error. Advanced Apex Specialist Superbadge - Step 3 Issue . Contact contact = [SELECT Id, FirstName, LastName,Email,AccountId FROM Contact WHERE Email = test@test.com LIMIT 1]; Map mapOldCasesWithItems, Map mapOldCasesWithNewCases){. i wanted to excel myself in healthcloud domain of salesforce as i have started badges of that domain on trailhead Is that just automatically done behind the scenes? Start a discussion in the forum to get straight-up answers. im stuck in challenge 4. system.debug('leastValueMap '+leastValueMap); for(Case c : caseList){ Hi, public static Vehicle__c buildVehicle(){ newCase.Date_Reported__c = System.today(); { }. }. Please help ! Hey Nikhil. pr.Warehouse_SKU__c = (String)productMap.get(sku); If nothing happens, download GitHub Desktop and try again. You signed in with another tab or window. for(Equipment_Maintenance_Item__c item : items){ Wait for a minute and run it twice maybe before checking challenges. for(Case MRRecord: newList){ Map newCases = new Map(); And I might not be the best to advice on that particular section. system.debug(newEMIRecordList.size() +newEMIRecordList.size()); system.debug(newRoutineMaintenanceVehicleRecordIDList +newRoutineMaintenanceVehicleRecordIDList); Yeah, well make that someone yourself and do whatever the hell you want.. Trailhead solution for Apex Specialist superbadge return result; private static final string REQUEST_TYPE = Routine Maintenance; }. What is a word for the arcane equivalent of a monastery? Its been long time I completed those quests. List newEMIRecordList = new List(); Maybe not optimized! It is nothing but the name of the class created earlier. Variable does not exist: Equipment__c And execute in the anonymous window below: Read More: Salesforce Interview Questions and Answers We Swear By! SYSTEM.assertEquals(newReq.Date_Reported__c, system.today()); @istest This query will return all completed batch, future, and queryable jobs that were completed today. Hi Admin, List externalProducts = (List) JSON.deserializeUntyped(response.getBody()); Vehicle__c vehicle = buildVehicle(); Hi @Edgar Moran, Can you please send me complete code of this "Unlock the Apex Specialist Superbadge". for(Case MRRecord: newMap.values()){ Please update challenge 6 as well as all the related material. Apex Specialist Superbadge Use integration and business logic to push your Apex coding skills to the limit. }. if(Trigger.isBefore){ Did any DOS compatibility layers exist for any UNIX-like systems before DOS started to become outmoded? Rename cases and products to match the HowWeRoll schema, and assign all profiles to the custom HowWeRoll page layouts for those objects. Could you please point out the specific line of the code where the function has been used for me to check and get back to you more quickly. from Equipment_Maintenance_Item__c This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. update somethingToUpdate; Case newReq = [Select id, subject, type, Date_Reported__c, Vehicle__c, Date_Due__c if(MRRecord.Vehicle__c==EMIRecord.Maintenance_Request__r.Vehicle__c){ Hope it helps, find it at the bottom of the website or search site name on telegram. Hard times, Challenge 1 : Automate record creation Test.startTest(); Stuck on Superbadge Apex Specialist Step 4? } We could not find the class MaintenanceRequestHelperTest using assertions in the unit tests. leastValueMap.put(emi.Maintenance_Request__c,emi); newMRRecord.Type=Routine Maintenance; pr.Lifespan_Months__c = (Integer)productMap.get(lifespan) ; I have complete Idea of this coding bt I am not getting what to do before writing this code exactly for this challenge. List emiListToNewCase = new List(); Salesforce[] [] [], REST API Equipment_Maintenance_Item__c i2 = buildItem(newCases[i_fail].Id, equipment.Id); maintenanceNew.ContactId = contact.Id; newEMIRecord.Equipment__c=EMIRecord.Equipment__c; This superbadges require a bit of practical experience in apex and all of them are not available on trailhead. newCase.Type=typeCase; Hey Haja. Most of the other answers I found online also keep pointing to this Equipment__c field, which doesnt exist. maintenanceCycle=EMIRecord.Equipment__r.Maintenance_Cycle__c; }, public static void createNewEquipmentMaintenanceItem(Map newMap){ What sort of strategies would a medieval military use against a fantasy giant? newCase.Date_Reported__c=Date.today(); newCases.put(oneCase.Id, newRoutineCase); insert requestList; for(integer i = 0; i < 300; i++){ Trailhead newCase.Vehicle__c=vehicle; Use the included package content to . emiList = [Select id,name,Maintenance_Request__c,Equipment__r.Maintenance_Cycle__c from Equipment_Maintenance_Item__c where Maintenance_Request__c IN: caseIdSet]; Map leastValueMap = new Map(); Equipment_Maintenance_Item__c i1 = buildItem(newCases[i_ok].Id, equipment.Id); 2023 TechForce Services. tmpCases.add(newCases.get(oldId)); Thanks I would go over this course. Reddit and its partners use cookies and similar technologies to provide you with a better experience. Hey Ms ! trigger MaintenanceRequest on Case (before update, after update, before insert, after insert) { } for(Integer i_fail = 0; i_fail < 300; i_fail ++){ Start a discussion in the forum to get straight-up answers. Equipment_Maintenance_Item__c newEMIRecord = new Equipment_Maintenance_Item__c(); sign in Try it. Automate record creation using Apex | by Shiv Shankar | Medium Write Sign up Sign In 500 Apologies, but something went wrong on our end. So with that I could solve it. insert vehicle; enter image description here Tried creating another playground but still same issue. Honestly, I suggest reviewing the trailheads leading up to the apex super badge since the apex specialist Superbadge tests you on those core concepts. Apologies for m caught quite off guard at this moment. It did not work for me. } Advanced-Apex-Specialist Showcase your mastery of business process automation without writing a line of code. List createdCases = [Select Id from Case where Type = Routine Maintenance]; check if u have creted a process builder , i did create a proces builder and deactivated and it worked for me. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. By accepting all cookies, you agree to our use of cookies to deliver and maintain our services and site, improve the quality of Reddit, personalize Reddit content and advertising, and measure the effectiveness of advertising. This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. vehicleToEquipmentMap.put(MRRecord.Vehicle__c,EquipmentIDListUpdate); Hey harsh. Challenge Not yet complete heres whats wrong: Test.startTest() Test.stopTest() , , startTeststopTest, A. Super BadgeUnlockTipsTrailheadTipsUnlock APEX. I would recommend you to follow the blog rather than looking into the code. where status = :STATUS_NEW]; Equipment_Maintenance_Item__c workPart = [select id CronTrigger a=[SELECT Id FROM CronTrigger where NextFireTime > today]; System.assertEquals(jobID, a.Id,Schedule ); Originally published at https://shivshankarsfdc.com on July 29, 2019. If multiple equipments are used in the maintenance request, choose the shortest maintenance cycle to define the service date. Set setIdCases = new Set(); } where Maintenance_Request__c = :newReq.Id]; system.assert(workPart != null); Hi shruti. Challenge 4 - MaintenanceHelperTest.class if(c.Type == 'Repair' || c.Type == 'Routine Maintenance'){ newCase.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. Best Answer chosen by Mohammad Shahid Shah. check the solution martland has linked, lemme know if it is working fin Case newCase = buildCase(vehicle.Id,'Repair','DummyOK_'+i_ok); please help. newRoutineMaintenanceVehicleRecordIDList.add(MRRecord.Vehicle__c); newCaseList.add(newCase); newEMIRecord.Equipment__c=EMIRecord.Equipment__c; Is there a resource that I can go through that could help my understanding of apex broaden out and then attempt this superbadge. I have a background in programming but I just can't understand most of the challenge. When I jumped into the super badge I realised that lack a lot of info surrounding the Superbadge. 6. Please Concepts tested in this superbadge include: Apex Triggers . // This object is available in API version 17.0 and later. Cant remember precisely. Paste it below to help someone else looking. Vehicle__C vehicle = createVehicle(); list oldRequestIds = new list(); for(integer i = 0; i < 300; i++){ Accelerate learning across your organization. You should definitely complete the task on your own and you can get all the help. This is an unofficial (no salesforce sponsorship) forum to discuss getting certified and building on salesforce platforms (force.com, heroku, exacttarget, slack, etc. List tmpCases = new List(); insert emptyReq; Equipment_Maintenance_Item__c workP = createWorkPart(equipmentId, emptyReq.Id); public static void setupTest(){ List emiList = new List(); https://th-superbadge-apex.herokuapp.com/equipment’, Salesforce Certification Free Vouchers 2022, How to pass values and call a method from Parent-to-Child Lightning Aura Component, 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, Test scheduling logic to confirm action gets queued. Apex List newEMIRecordList = new List(); , Super } Trailhead Academy. Use above code for step 5 and then use system assert with constant 0 and returned value will be 0. Are you sure you want to create this branch? Good luck to you all if you are working on this superbadge or preparing for the Salesforce Platform Developer II certification. Help with Superbadge Apex Specialist Step 3? Apex Specialist is one of the superbadges of Salesforce trailhead(A New Approach to Learning Salesforce). Here I have no idea what the input is nor what the output is supposed to be. } static void allTheDataForThisTestClass() {. newEquipment.Replacement_Part__c = true; public static Case buildCase(Id vehicleId, String typeCase, String subjectCase){ contact.FirstName = test; Getting so many queries on this one I will surely try prioritize. Eigenmann & Veronelli un Gruppo internazionale che nasce nel 1910 leader nella distribuzione di specialit chimiche e ingredienti alimentari per l'industria.. Con circa 340 dipendenti e . Test.setMock(HttpCalloutMock.class, new WarehouseCalloutServiceMock()); emiListToBeUpdated.add(e); Salesforce Interview Questions and Answers We Swear By! Thanks for letting know. To learn more, see our tips on writing great answers. Use Git or checkout with SVN using the web URL. if(vehicleToEquipmentMap.get(MRRecord.Vehicle__c)!=null){ Product needs to be renamed as Equipment not Vehicle since Vehicle is already provided to us in the installed package. private static final string CLOSED = Closed; I am not able understand the issue, can you please help?? I can fairly understand parts of it but never get the compete picture. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. } id vehicleId = vehicle.Id; product2 equipment = createEq(); Set oldIdCases = newCases.keySet(); Hi Niya. test.stopTest(); list allRequests = [select id You have to insert as many work parts records for each inserted new case record. Superbadge Process Automation Specialist Full Solutions. List emiListToBeUpdated = new List(); for(case c:caseList){ where Maintenance_Request__c in: oldRequestIds]; system.assert(allRequests.size() == 300); I ll look into it and get back to you shortly. insert workP; test.startTest(); 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 Hi guys, I'm almost finished with the test to get tge Apex Specialist SuperBadge, I attempt to validate the "Test automation logic" but I can't really see what is my error or why is not passing. // List caselist = [Select count(id) from case where case] } update caseToUpdate; Stuck on Superbadge Apex Specialist Step 6? Is it a bug? 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. Hi the challenge has been updated. Follow guided learning paths. Set Up Development Org . private static final string REQUEST_SUBJECT = Testing subject; PRIVATE STATIC Vehicle__c createVehicle(){ Step 1. Create your own notes with your understanding and you can ask a senior at work to review them for you. list vehicleList = new list(); List EquipmentIDListUpdate = new List(); mapCases.put(oldCaseId,new List()); User u = new User(Alias = stdtest, Email=stdtest@testorg.com, I had cleared this superbadge way back in time would have to seriously redo it to understand what was done on this one. Lightning Experience Specialist Save my name, email, and website in this browser for the next time I comment. Advanced-Apex-Specialist-Salesforce-Super-Badge. I am getting Variable does not exist: MaintenanceRequestTest error. hi niya ~1 hr 30 mins +1,500 points Module Apex Testing Write robust code by executing Apex unit tests. workPartList.add(createWorkPart(equipmentList.get(i).id, requestList.get(i).id)); if((oneCase.status==closed) && (oneCase.type==Repair || oneCase.type==Routine Maintenance)) { You have to rename the two standard fields as indicated and then the mentioned changes in apex and trigger codes. } hi, martand please lemme know if it is verified, I ll update the same! Please lemme know if works. for(Case MRRecord: newList){ 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. Its a pretty long post that i wrote quiet long time back. Find centralized, trusted content and collaborate around the technologies you use most. Trigger.new, ApexHTTPHttpHttpRequestHttpResponse I am getting invalid type schema: for work_part__c, can you help me how to resolve this on, it doesnt seems typo error, but i cant find any field of such type also. public static void updateWorkOrders(List caseList) { system.assertEquals(newReq.Type, REQUEST_TYPE); GROUP BY Maintenance_Request__r.ID ]; Unlock, Apex Specialist Super Badge Set caseIdSet = new Set(); Map oldNewCaseMap = new Map(); ProductId=equipmentId, If you're if that type, you can read the apex developer documentation. pr.Current_Inventory__c = (Integer)productMap.get(quantity); } }. Learn more. , ApexApex()75%Apex(1%) 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++){ if(Trigger.isUpdate){ Closing a Maintenance Request of type 'Routine Maintenance' or 'Repair' did not create of a new Maintenance Request with the correct due date. Test.startTest(); request.setEndpoint(WAREHOUSE_URL); Superbadge Process Automation Specialist Full Solutions. This repository is for solving all the problems and pass all the challenges in the way of earning this superbadge.