Skip to content

Instantly share code, notes, and snippets.

mutation {
Account(Name: Test) {
Id
Name
Contact(FirstName: Joe, LastName: Smith) {
Id
Task(Subject: Call Joe) {
Id
}
}
mutation {
Account(Name: Test) {
Id
Name
CreatedDate
}
}
Verifying my Blockstack ID is secured with the address 1rvPJ3XUnRRkEGK3HGzogEHQ9WVhndsKy https://explorer.blockstack.org/address/1rvPJ3XUnRRkEGK3HGzogEHQ9WVhndsKy
@aptkdev
aptkdev / docgen4.css
Created July 1, 2019 14:33
Document Generation 4
/* add margin and size to our page */
@Page {
size: 300px;
margin: 20px;
/* add page's header and footer */
@top-left {
content: element(header-section);
}
@bottom-left {
content: element(footer-section);
@aptkdev
aptkdev / docgen5.html
Last active June 27, 2019 15:55
Document Generation 5
<apex:page standardController="Account" renderAs="PDF">
<h1 style="font-size: 70px; color: #009900">Hello {!record.Id}!</h1>
</apex:page>
@aptkdev
aptkdev / docgen6.java
Last active June 27, 2019 15:51
Document Generation 6
public class Example {
public static Blob generatePDF(String recordId) {
// create a virtual page
PageReference page = new PageReference('/apex/MyPage');
// add our record id
page.getParameters().put('Id', recordId);
// generate and PDF blob
// You can save this blob as a file, document, or attachment!
return page.getContentAsPDF();
@aptkdev
aptkdev / docgen3.html
Last active July 1, 2019 14:33
Document Generation Step 3
<apex:page renderAs="PDF">
<apex:stylesheet value="{!$Resource.myPageStyle}"/>
<h1 style="font-size: 70px; color: #009900">Hello World!</h1>
</apex:page>
@aptkdev
aptkdev / docgen2.html
Last active June 27, 2019 15:29
Document Generation Step 2
<apex:page renderAs="PDF">
<head>
<style type="text/css">
h1 {
font-size: 70px;
color: #009900
}
</style>
</head>
@aptkdev
aptkdev / docgen1.html
Last active June 27, 2019 15:19
Document Generation Step I
<apex:page renderAs="PDF">
<h1>Hello World!</h1>
</apex:page>
@aptkdev
aptkdev / ApexFileUpload.cls
Created February 15, 2018 11:54
Apex File File Upload (Using ContentVersion)
/*
* @class FileUploaderClass
* @desc Lets you uplaod a file in Salesforce by giving a base64 string of the
* file, a name for the file, and the Id of the record that you want to attach
* the file to.
*
* @example:
* FileUploaderClass.uploadFile(myBase64String, 'Invoice.pdf', '906F0000000kG2UIAU')
*/
public class FileUploaderClass {