Skip to content

Instantly share code, notes, and snippets.

View JennSchnell's full-sized avatar

JennS JennSchnell

  • MI
View GitHub Profile
@JennSchnell
JennSchnell / gist:999b40a95c79d6365375965ac283e673
Created November 27, 2017 19:26
LeadConvert Custom JavaScript Button
{!REQUIRESCRIPT("/soap/ajax/41.0/connection.js")}
var industry = '{!JSENCODE(Lead.Industry)}';
var annualrevenue = '{!JSENCODE(Lead.AnnualRevenue)}';
if (industry == '' || annualrevenue == '' ){
alert('Reminder: Please ensure the Industry and Annual Revenue fields are completed before you convert this lead.');
}
else{
window.parent.location.href="lead/leadconvert.jsp?retURL=%2F"+'{!Lead.Id}'+"&id="+'{!Lead.Id}';
}
@JennSchnell
JennSchnell / gist:8162f6c83c44e8077f0e35d3480bfd08
Created November 15, 2017 18:27
AssetTriggerHandlerTest.apxc
@IsTest
private class AssetTriggerHandlerTest
{
@testSetup
static void setup()
{
Account a = new Account(Name = 'Test Account');
insert a;
List<Product2> prods = new List<Product2>();
@isTest(SeeAllData=true)
private class BillingScheduleTest{
/* @testSetup static void TestBillingSchedule(){
Account objAccount = new Account();
objAccount.Name = 'TestAccount';
objAccount.Phone = '1234567890';
objAccount.CurrencyIsoCode ='USD';
insert objAccount;