This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest | |
public class TestLimitCasesBulk { | |
static testMethod void testLimitCasesBulk() { | |
//Principle #1: Create records from scratch | |
//1. Create the custom setting | |
Max_Cases__c maxNoCases = new Max_Cases__c(); | |
maxNoCases.MaxCases__c = 250; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page standardcontroller="QA_Release__c" extensions="DuplicateQARelController" showHeader="false" sidebar="false"> | |
<apex:image value="{!$Resource.img2}" styleClass="logo" width="25%"/> | |
<apex:form > | |
<apex:pageBlock title="Multiple QA tasks alert!"> | |
<apex:outputPanel styleClass="rules"> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class DuplicateQARelController{ | |
//Declare the variables to be used | |
public List<QA_Release__c> releases {get;set;} | |
private Id releaseClientId; | |
private final QA_Release__c qa; | |
//Put all code inside constructor since it will be initialized when page is rendered | |
public DuplicateQARelController(ApexPages.StandardController stdController) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var message = ''; | |
var ctr = 0; | |
var storeSearch = []; | |
var result = ''; | |
function print(message) { | |
var outputDiv = document.getElementById('output'); | |
outputDiv.innerHTML = message; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var students = [ | |
{ | |
name: 'Mayank', | |
track: 'jQuery', | |
achievements: 158, | |
points: 15000 | |
}, | |
{ | |
name: 'Deepu', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
OlderNewer