Skip to content

Instantly share code, notes, and snippets.

@brianmfear
brianmfear / GetExtraLimitsForYourUnitTest.apxc
Last active January 11, 2024 05:09
Need more CPU or heap for creating your test data? Make it Queueable.
// Asking for extra CPU time and heap for those really "heavy" orgs
@isTest class GetExtraLimitsForYourUnitTest implements Queueable {
@testSetup static void testSetup() {
Test.startTest(); // TIP: this avoids governor limits for your @isTest methods
System.enqueueJob(new GetExtraLimitsForYourUnitTest()); // We'll get async limits!
// P.S. Did you know that the end of a unit test method triggers async code,
// just as if you called Test.stopTest()?
}
public void execute(QueueableContext context) {
// I now have 60000ms to do my setup, instead of just 10000ms.
@gminero
gminero / samplePopover.html
Created April 10, 2019 01:00
Sample slds table with popover of related record
<template>
<div>
<template if:true={ranger} >
<lightning-record-view-form
record-id={ranger}
object-api-name="Contact">
<div class="potato slds-box" style={boxClass}>
<lightning-output-field field-name="Name">
</lightning-output-field>
<lightning-output-field field-name="Email">
@rapsacnz
rapsacnz / Utilities.cls
Created June 20, 2017 22:01
Apex Utilities
/**
* Created by caspar on 20/05/16.
*/
public without sharing class Utilities {
public static Map<String, List<String>> fieldsForType = new Map<String, List<String>>();
/**
* Retrieves a list of sObjects