\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{surelyplus} \pdfinfo{ /Title (salesforce-visualforce-page.pdf) /Creator (Cheatography) /Author (surelyplus) /Subject (SalesForce Visualforce Page Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{00263E} \definecolor{LightBackground}{HTML}{F7F8F8} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{SalesForce Visualforce Page Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{surelyplus} via \textcolor{DarkBackground}{\uline{cheatography.com/77089/cs/18929/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}surelyplus \\ \uline{cheatography.com/surelyplus} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 22nd February, 2019.\\ Updated 22nd February, 2019.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Global Variables}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{\$Action}}\{\{nobreak\}\} & global merge field type to use when referencing standard Salesforce actions \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} {\bf{\$Api}} & global merge field type to use when referencing API URLs \tn % Row Count 7 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{\$Asset}} & global merge field to use when referencing images and other assets that are part of the Lightning Design System \tn % Row Count 13 (+ 6) % Row 3 \SetRowColor{white} {\bf{\$Cache.Org}} & global merge field to access an org cache from a Visualforce page. Retrieve cached values from a specified partition's org cache in the referenced org \tn % Row Count 21 (+ 8) % Row 4 \SetRowColor{LightBackground} {\bf{\$Cache.Session}}\{\{nobreak\}\} & global merge field to access an org's session cache from a Visualforce page. Retrieve cached values from a specified partition's session cache in the referenced org. \tn % Row Count 30 (+ 9) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Global Variables (cont)}} \tn % Row 5 \SetRowColor{LightBackground} {\bf{\$Component}} & global merge field type to use when referencing a Visualforce component \tn % Row Count 4 (+ 4) % Row 6 \SetRowColor{white} {\bf{\$ComponentLabel}}\{\{nobreak\}\} & global merge field to use when referencing the label of an inputField component on a Visualforce page that is associated with a message \tn % Row Count 11 (+ 7) % Row 7 \SetRowColor{LightBackground} {\bf{\$CurrentPage}} & global merge field type to use when referencing the current Visualforce page or page request \tn % Row Count 16 (+ 5) % Row 8 \SetRowColor{white} {\bf{\$FieldSet}} & Provides access to a field set defined in your organization \tn % Row Count 19 (+ 3) % Row 9 \SetRowColor{LightBackground} {\bf{\$Label}} & global merge field type to use when referencing a custom label \tn % Row Count 23 (+ 4) % Row 10 \SetRowColor{white} {\bf{\$Label.Site}} & global merge field type to use when referencing a standard Sites label in a Visualforce page. Like all standard labels, the text will display based on the user's language and locale \tn % Row Count 33 (+ 10) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Global Variables (cont)}} \tn % Row 11 \SetRowColor{LightBackground} {\bf{\$Network}} & global merge field type to use when referencing community details in a Visualforce email template \tn % Row Count 5 (+ 5) % Row 12 \SetRowColor{white} {\bf{\$ObjectType}} & global merge field type to use when referencing standard or custom objects (such as Accounts, Cases, or Opportunities) and the values of their fields \tn % Row Count 13 (+ 8) % Row 13 \SetRowColor{LightBackground} {\bf{\$Organization}} & global merge field type to use when referencing information about your company profile. Use organization merge fields to reference your organization's city, fax, ID, or other details. \tn % Row Count 23 (+ 10) % Row 14 \SetRowColor{white} {\bf{\$Page}} & global merge field type to use when referencing a Visualforce page \tn % Row Count 27 (+ 4) % Row 15 \SetRowColor{LightBackground} {\bf{\$Permission}} & global merge field type to use when referencing information about the current user's custom permission access. Use permission merge fields to reference information about the user's current access to any of your organization's custom permissions \tn % Row Count 40 (+ 13) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Global Variables (cont)}} \tn % Row 16 \SetRowColor{LightBackground} {\bf{\$Profile}} & global merge field type to use when referencing information about the current user's profile. Use profile merge fields to reference information about the user's profile such as license type or name \tn % Row Count 11 (+ 11) % Row 17 \SetRowColor{white} {\bf{\$Resource}} & global merge field type to use when referencing an existing static resource by name in a Visualforce page. You can also use resource merge fields in URLFOR functions to reference a particular file in a static resource archive \tn % Row Count 23 (+ 12) % Row 18 \SetRowColor{LightBackground} {\bf{\$SControl}} & global merge field type to use when referencing an existing custom s-control by name. This merge field type results in a URL to a page where the s-control executes \tn % Row Count 32 (+ 9) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Global Variables (cont)}} \tn % Row 19 \SetRowColor{LightBackground} {\bf{\$Setup}} & global merge field type to use when referencing a custom setting of type "hierarchy." \tn % Row Count 5 (+ 5) % Row 20 \SetRowColor{white} {\bf{\$Site}} & global merge field type to use when referencing information about the current Salesforce site \tn % Row Count 10 (+ 5) % Row 21 \SetRowColor{LightBackground} {\bf{\$System.OriginDateTime}} & global merge field that represents the literal value of 1900-01-01 00:00:00 \tn % Row Count 14 (+ 4) % Row 22 \SetRowColor{white} {\bf{\$User}} & global merge field type to use when referencing information about the current user. User merge fields can reference information about the user such as alias, title, and ID. Most of the fields available on the User standard object are also available on \$User \tn % Row Count 27 (+ 13) % Row 23 \SetRowColor{LightBackground} {\bf{\$User.UITheme}}\{\{nl\}\}{\bf{\$User.UIThemeDisplayed}} & global merge fields identify the Salesforce look and feel a user sees on a given Web page \tn % Row Count 32 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Global Variables (cont)}} \tn % Row 24 \SetRowColor{LightBackground} {\bf{\$UserRole}} & global merge field type to use when referencing information about the current user's role. Role merge fields can reference information such as role name, description, and ID \tn % Row Count 9 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{HowTo}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Use global variables to reference general information about the current user and your organization on a page. \newline % Row Count 3 (+ 3) Global variables must be referenced using Visualforce expression syntax to be evaluated, for example, \{!\$User.FirstName\}. \newline % Row Count 6 (+ 3) \{\{popup="https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages\_variables\_global.htm"\}\}Visualforce Developer Guide\{\{/popup\}\}% Row Count 9 (+ 3) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}