<apex:page showHeader="false" applyHtmlTag="true" applyBodyTag="false">
<apex:includeScript value="https://code.jquery.com/jquery-2.2.4.js" />
<script>
var PARENT_ID = '0010800002t8mrYAAQ'; //change Id to your record Id
jQuery(document).ready(function ($) {
$('input#file').on('change', function (e) {
for (var i = 0; i < this.files.length; i++) {
uploading += 1;
upload_file(this.files[i], PARENT_ID, function (err, res) {
View UploadContentDocument.md
View list_id.md
Common way
List<Contact> contacts = [Select Id, Name from Contact];
List<Id> contactIds = new List<Id>();
for(Contact c: contacts){
contactIds.add(c.Id);
}
One line only
View csv copy
This file contains 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
```bash | |
cat annotations.csv|while read line | |
do | |
read -d, col1 <<(echo $line) | |
echo "$col1" | |
cp "./$col1" "./images/$col1" | |
done | |
``` |
View RemoteAction.md
Apex Controller
public class CasePriority {
@RemoteAction
public static list<Case> getCases(string priority) {
list<Case> cases = [Select Id, CaseNumber, Subject, Description, Priority, Status
From Case
Where Priority = :priority
And Status = 'New'
View dump_heroku_postgres.md
pg_restore --verbose --clean --no-acl --no-owner -h db -U postgres -d postgres latest.dump
https://devcenter.heroku.com/articles/heroku-postgres-import-export
View VisualforceRenderAsPdf_template.xml
This file contains 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 applyHtmlTag="false" | |
showHeader="false" | |
renderAs="pdf"> | |
<html> | |
<head> | |
<style> | |
@page { | |
size: A4 | |
} | |
</style> |
View VisualforceRenderAsPdf.xml
This file contains 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 renderAs="pdf"> | |
</apex:page> |
View EnvelopeContactAddressPrint.xml
This file contains 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 standardController="Contact" | |
applyHtmlTag="false" | |
showHeader="false" | |
renderAs="pdf"> | |
<html> | |
<head> | |
<style> | |
@page { | |
size: 6.4in 4.5in; | |
} |