##Custom Invoice Templates
Last Updated: 7/20/15
####Goal After following this guide, you should be able to create custom invoice templates by leveraging the custom invoice components and controllers, along with CSS.
####Prerequisites
| <!-- | |
| * Author: Jenish Shingala | |
| * Description: Stack Area Chart Page. | |
| This page Shows Last 30 days Record Count of Closed Won/Lost Opportunities. | |
| --> | |
| <apex:page controller="opportunityStackAreaChart" sidebar="false"> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
| <!--D3 Libraries--> | |
| <apex:includeScript value="{!$Resource.d3}"/> |
| //Provide the id of the default user for new leads or the default queue for new leads so we can make sure we only get rid of these leads | |
| String ownerId = '00Go0000001iGfU'; | |
| //Start with a list of all leads with email addresses that are not converted (and in our case not currently with a status of Duplicate) | |
| //Also pull owner ID so we can use that to determine if the leads are owned by the new lead queue (or not) | |
| List<Lead> newleads = [select id, email, ownerid from Lead where email != null and isConverted = false and Status != 'Duplicate']; | |
| //Create a map, indexed by email, that will store lists of leads with the same email address | |
| Map<String, List<Lead>> leadsByEmail = new Map<String, List<Lead>>(); |
| <!-- | |
| Name: VoucherTemplate.page | |
| Copyright © 2015 Kaptio ehf. | |
| ====================================================== | |
| ====================================================== | |
| Purpose: | |
| ------- | |
| A Visualforce template for vouchers within Kaptio Travel. | |
| Can be used to create custom voucher outputs. | |
| ====================================================== |
| @isTest | |
| private class TestDemoWebCallout { | |
| static testMethod void testRestfulCallout() { | |
| Lead l = new Lead(); | |
| l.Status = 'Open'; | |
| l.LastName = 'Owen'; | |
| l.FirstName = 'Bob'; | |
| l.Street = '1234 Sesame Street'; | |
| l.City = 'Houston'; |
This is an adaptation of Cody Sechelski's Create a Calendar View in Salesforce.com.
The main problem with his implementation was that it wasn't handling more than 2000 records. This was due to a Apex workaround, as it is reserves start and end variables, Cody made a repeat table and parsed that into JavaScript object. My solution creates JSON string in Apex and then uses string function to replace all startString and endString instances. A more sensible solution would involve recreating the object in JavaScript or simply editing the FullCalendar library to look for different variable names.
I have also simplified the code a bit so you can start working towards your personal implementation. As this is using JavaScript remoting, I hope this gives you a framework to work towards more advanced features like editing or optimizing request sizes (executing a request on next month load).
The page
<apex:page showHeader="fals
| Apex Coding Standard | |
| Introduction | |
| ------------- | |
| Apex is a strongly-typed, object-oriented, proprietary programming language for the Force.com platform. | |
| It lets you execute flow and transaction control statements in conjunction with calls to the Force.com API. | |
| Apex borrows it's syntax from Java, and functions like a database stored procedure. | |
| To learn more about Apex, read the developer documentation on the Force.com developer site. | |
| [http://www.salesforce.com/us/developer/docs/apexcode/index.htm] |
| <messaging:emailTemplate subject="Close Opportunity" | |
| recipientType="User" | |
| relatedToType="Opportunity"> | |
| <messaging:htmlEmailBody > | |
| <html> | |
| <body> | |
| Opportunity: <a href="https://test.salesforce.com/{!relatedTo.id}"><apex:outputText value="{!relatedTo.name}"/></a> | |
| <br/> |
| <apex:page> | |
| <head> | |
| <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / > | |
| <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" /> | |
| <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" /> | |
| <!-- I have a static resource called famfamfam which is the zip file from http://www.famfamfam.com/lab/icons/silk/famfamfam_silk_icons_v013.zip --> | |
| <style> |
| Afghanistan | |
| Albania | |
| Algeria | |
| Andorra | |
| Angola | |
| Antigua & Deps | |
| Argentina | |
| Armenia | |
| Australia | |
| Austria |