Skip to content

Instantly share code, notes, and snippets.

public class AggregateStateInfo
{
@InvocableMethod
//Method that accepts the Account ID
{
// Find all related Location_Information__c records and store the State__c value in a collection variable
// Make sure the values are not duplicates
// Update a custom field on Account (Aggregated_State_Info__c [Text type]) with the de-duplicated States separated by a comma
}
}
public class ChannelRelationshipController{
//Attributes
public Id opporunityId {get;set;}
public String retUrl {get;set;}
public String partnerDistributorIds {get;set;}
public boolean saveandAddproducts{get;set;}
//Constructors
public ChannelRelationshipController(ApexPages.StandardController con) {
<apex:page showHeader="true" sidebar="true" docType="html-5.0" standardStylesheets="true" applyBodyTag="true" standardController="Opportunity" extensions="ChannelRelationshipController">
<html ng-app="ResellerDistributor" lang="en">
<head>
<title>Reseller Distributor Channel</title>
<!--<link href="{!URLFOR($Resource.Angular_Bootstrap,'Angular_Bootstrap/Bootstrap/BootsWatchThemes/sandstone/bootstrap.min.css')}" rel="stylesheet"/> -->
<link href="{!URLFOR($Resource.Angular_Bootstrap,'Angular_Bootstrap/AngularJs/css/ng-table.min.css')}" rel="stylesheet"/>
<apex:includeScript value="{!URLFOR($Resource.Angular_Bootstrap, 'Angular_Bootstrap/Jquery/external/jquery/jquery.js')}"/>
<!--<apex:includeScript value="{!URLFOR($Resource.Angular_Bootstrap, 'Angular_Bootstrap/Bootstrap/js/bootstrap.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.Angular_Bootstrap, 'Angular_Bootstrap/Bootbox/bootbox.js')}"/>-->
trigger MasterContactTrigger on Contact(
before insert, after insert,
before update, after update,
before delete, after delete) {
if (Trigger.isBefore) {
if (Trigger.isInsert) {
//Transfer all newly created contacts to SFDC99 Account
TransferContact tfc = new TransferContact(Trigger.new);
tfc.assignToAccount();
@miragedeb
miragedeb / gist:63d5046482006d226d8b
Created June 17, 2015 16:34
ProcessTerlerikEmail
global class ProcessTelerikEmail implements Messaging.InboundEmailHandler {
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email,
Messaging.InboundEnvelope envelope) {
Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
List<Account> allAccountsToUpdate = new List<Account>();
for( Account acc: [SELECT Id, Burn_Test_runtime__c , Pass_Fail__c
FROM Account WHERE Account_Status__c = 'Client'
AND Hosted__c != 'Client-Internal'
AND DR_Server__c ='s3.emea2'])
@miragedeb
miragedeb / LimitCases.cls
Created April 1, 2015 17:28
Extravagant Record Creation
trigger LimitCases on Case (before insert) {
//Extract the custom setting value into a variable
Max_Cases__c maxCase = Max_Cases__c.getInstance('maxcases');
Decimal maxNoCases = maxCase.MaxCases__c;
System.debug('The max no. of cases setting is:' + maxNoCases);
//1. Create a set of all Owner Id's whose cases are being fed for import
Map<Id,Integer> ownerCasesMap = new Map<Id,Integer>();
@miragedeb
miragedeb / students.js
Created April 1, 2015 17:26
students.js
var students = [
{
name: 'Mayank',
track: 'jQuery',
achievements: 158,
points: 15000
},
{
name: 'Deepu',
@miragedeb
miragedeb / student_printer.js
Created April 1, 2015 17:26
Printing Students
var message = '';
var ctr = 0;
var storeSearch = [];
var result = '';
function print(message) {
var outputDiv = document.getElementById('output');
outputDiv.innerHTML = message;
@miragedeb
miragedeb / TaskOpenerController
Last active August 29, 2015 14:17
TaskOpenerController
public with sharing class TaskOpenerController{
public List<QA_Release__c> releases {get;set;}
public Integer numberOfReleases {get;set;}
public Id qaId {get;set;}
public DateTime creDate {get;set;}
private Id releaseClientId;
public Decimal difference {get;set;}
public TaskOpenerController (ApexPages.StandardController stdcontroller) {
@miragedeb
miragedeb / TaskOpenerPage
Last active August 29, 2015 14:17
TaskOpener
<apex:page standardController="QA_Release__c" extensions="TaskOpenerController" showHeader="false" sidebar="false">
<script>
if({!numberOfReleases} >= 1 && {!difference} <=1 ) {
window.open("/apex/QADuplicateAlert?id={!qaId}", "Open Tasks", "width=600, height=400");
}
</script>
</apex:page>