Skip to content

Instantly share code, notes, and snippets.

@cyberjus
cyberjus / Test.cls
Created December 27, 2018 16:04
LWC Object Array
public with sharing class Test {
@AuraEnabled(cacheable=true)
public static TestObj[] getList() {
TestObj[] tests = new TestObj[]{
new TestObj('1', 'Item 1'),
new TestObj('2', 'Item 2'),
new TestObj('3', 'Item 3')
};
return tests;
@cyberjus
cyberjus / gist:0bd8c974c6f370e35b77
Created August 15, 2014 15:24
Apex Strip Email Replies Method
/**
* This utility attempts to strip the reply portion of an email by looking for common reply seperators
* The reply separator depends on the email client, so it is not likely to strip all replies 100%
* This is a best effort for known email client formats.
*
* @param String original email message body
* @returns String email message with the reply lines stripped
*/
public static String stripResponse(String email) {
@cyberjus
cyberjus / gist:1ed5f21e05524831fb98
Created July 7, 2014 21:23
Chatterless Community Pages Work Around
<apex:page standardController="Case">
<apex:outputPanel rendered="{!$Profile.Name != 'Community User'}" >
<apex:detail subject="{!Case.Id}" inlineEdit="true" showChatter="true" />
</apex:outputPanel>
<apex:outputPanel rendered="{!$Profile.Name = 'Community User'}" >
<apex:detail subject="{!Case.Id}" inlineEdit="true" showChatter="false" />
</apex:outputPanel>
@cyberjus
cyberjus / AccountTriggerHandler.cls
Created November 26, 2012 15:11
SFDC Trigger Template
public class AccountTriggerHandler extends TriggerHandler {
// Build method to bind events to functions
public void build() {
System.debug('Build Account Trigger');
bind(TriggerManager.Evt.AfterUpdate, new AccountAfterUpdateHandler());
bind(TriggerManager.Evt.AfterUpdate, new UpdateAccount());
}