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 RestrictInvoiceDeletion on Invoice__c (before delete) { | |
| // With each of the invoice statements targeted by the trigger | |
| // and that have line items, add an error to prevent them | |
| // from being deleted. | |
| for (Invoice__c invoice : | |
| [SELECT Id | |
| FROM Invoice__c | |
| WHERE Id IN (SELECT Invoice__c FROM Line_Item__c) AND | |
| Id IN :Trigger.old]){ | |
| Trigger.oldMap.get(invoice.Id).addError('Cannot delete invoice statement with lineitems'); |
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
| // Create Warehouse if one does not exist | |
| Warehouse__c w; | |
| List<Warehouse__c> warehouse = [SELECT ID from Warehouse__c]; | |
| if(warehouse.size() == 1) { | |
| w = new Warehouse__c( | |
| Name='Warehouse 1', | |
| City__c='San Francisco', | |
| Location__Latitude__s=37.7833, | |
| Location__Longitude__s=122.4167); |
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 | |
| private class TestCleanUpBatchClass { | |
| static testmethod void test() { | |
| // The query used by the batch job. | |
| String query = 'SELECT Id,CreatedDate FROM Merchandise__c ' + | |
| 'WHERE Id NOT IN (SELECT Merchandise__c FROM Line_Item__c)'; | |
| // Create some test merchandise items to be deleted | |
| // by the batch job. | |
| Warehouse__c w = new Warehouse__c( |
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 TestDataFactory { | |
| public static Invoice__c createOneInvoiceStatement( | |
| Boolean withLineItem) { | |
| // Create Warehouse if one does not exist | |
| Warehouse__c w; | |
| List<Warehouse__c> warehouse = [SELECT ID from Warehouse__c]; | |
| if(warehouse.size() == 0) { |
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 showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false"> | |
| <HTML> | |
| <HEAD> | |
| <script src="{!URLFOR($Resource.jquery)}"></script> | |
| <script src="{!URLFOR($Resource.CanJS,'can.jquery.js')}"></script> | |
| <script src="{!URLFOR($Resource.bootstrap,'js/bootstrap.js')}"></script> | |
| <link rel="stylesheet" href="{!URLFOR($Resource.bootstrap, 'css/bootstrap.css')}"></link> | |
| <apex:remoteObjects > | |
| <apex:remoteObjectModel name="Contact" jsShorthand="contact" fields="Name,Id,Email"/> | |
| <script> |
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 with sharing class BlogLog_Retrieve implements Schedulable { | |
| public BlogLog_Retrieve() {} | |
| global void execute(SchedulableContext c) { | |
| updateBlogData(); | |
| updateTwitterData(); | |
| } | |
| global class BlogPost { |
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 BlogLog_Services implements Messaging.InboundEmailHandler { | |
| public BlogLog_Services() {} | |
| public Document document { | |
| get { | |
| if (document == null) | |
| document = new Document(); | |
| return document; | |
| } |
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 docType="html-5.0" | |
| showHeader="false" sidebar="false" applyBodyTag="false" standardStylesheets="false"> | |
| <apex:stylesheet value="{!URLFOR($Resource.OneCSS,'icons.css')}"/> | |
| <apex:stylesheet value="{!URLFOR($Resource.OneCSS,'styles.css')}"/> | |
| <apex:includeScript value="{!URLFOR($Resource.jquery)}"/> | |
| <apex:includeScript value="{!URLFOR($Resource.TouchSwipe,'jquery.touchSwipe.min.js')}"/> | |
| <head> | |
| <title>S1 Starter</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
| <style> |
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 showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false"> | |
| <HTML> | |
| <HEAD> | |
| <script src="{!URLFOR($Resource.jquery)}"></script> | |
| <script src="{!URLFOR($Resource.canjs)}"></script> | |
| <script src="{!URLFOR($Resource.bootstrap,'js/bootstrap.js')}"></script> | |
| <link rel="stylesheet" href="{!URLFOR($Resource.bootstrap, 'css/bootstrap.css')}"></link> | |
| <apex:remoteObjects > | |
| <apex:remoteObjectModel name="blitz4lifeU__Vehicle__c" jsShorthand="Vehicle" fields="Name,Id,blitz4lifeU__Make__c ,blitz4lifeU__Model__c,blitz4lifeU__Wheels__c"/> | |
| <script> |
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 class InvoiceNegotiatorController{ | |
| public Id recordId {get; set;} | |
| public String price {get; set;} | |
| public String quantity {get; set;} | |
| public String priceDollar {get; set;} | |
| public String priceCents {get; set;} | |
| public class InvoiceList { |