Skip to content

Instantly share code, notes, and snippets.

View zachelrath's full-sized avatar

Zach McElrath zachelrath

View GitHub Profile
@zachelrath
zachelrath / OpportunityDetail.xml
Created April 24, 2014 20:39
Opportunity Detail page with "Shopping Cart" for picking Products / Line Items
<skuidpage showsidebar="false" showheader="true" tabtooverride="Opportunity">
<resources>
<labels/>
<javascript>
<jsitem location="inline" name="markCompleted" url="">skuid.snippet.registerSnippet('tasks.markCompleted',function(params){
// Mark all selected items as closed,
// then save our 2 Tasks models
var model = params.model,
list = params.list,
selectedItems = params.item ? [params.item] : list.getSelectedItems();
<skuidpage showsidebar="false" showheader="true" tabtooverride="Contact">
<models>
<model id="Contact" limit="100" query="true" createrowifnonefound="false" sobject="Contact">
<fields>
<field id="CreatedDate"/>
<field id="AccountId"/>
<field id="Account.Name"/>
<field id="Birthdate"/>
<field id="Name"/>
</fields>
<skuidpage showsidebar="false" showheader="true" tabtooverride="Contact">
<models>
<model id="ContactData" limit="1" query="true" createrowifnonefound="false" sobject="Contact">
<fields>
<field id="FirstName"/>
<field id="LastName"/>
<field id="CreatedDate"/>
<field id="AccountId"/>
<field id="Account.Name"/>
<field id="Email"/>
<skuidpage showsidebar="true" showheader="true" tabtooverride="Contact">
<models>
<model id="Contact" limit="100" query="true" createrowifnonefound="false" sobject="Contact">
<fields>
<field id="FirstName"/>
<field id="LastName"/>
<field id="CreatedDate"/>
</fields>
<conditions>
<condition type="param" value="accountid" field="AccountId" operator="=" enclosevalueinquotes="true"/>
<skuidpage showsidebar="false" showheader="true" tabtooverride="Account">
<models>
<model id="Account" limit="100" query="true" createrowifnonefound="false" sobject="Account">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
</fields>
<conditions/>
</model>
</models>
@zachelrath
zachelrath / ViewCaseWeb.xml
Created March 25, 2014 23:02
Skuid Page XML for viewing a Case as a Force.com Site Guest User, that allows you to upload Attachments to the Case, as well as to the named "skuid__Photo__c" Lookup to the skuid__Image__c (File) object
<skuidpage showsidebar="false" showheader="false" tabtooverride="Case">
<models>
<model id="Case" limit="1" query="true" createrowifnonefound="false" sobject="Case">
<fields>
<field id="CaseNumber"/>
<field id="CreatedDate"/>
<field id="Subject"/>
<field id="Description"/>
<field id="Status"/>
<field id="skuid__Photo__c"/>
@zachelrath
zachelrath / LogACaseWeb.xml
Created March 25, 2014 23:00
Skuid Page XML for logging a Case from a Force.com Site and pre-creating a skuid__Image__c record that gets thrown into a "skuid__Photo__c" field on the new Case.
<skuidpage showsidebar="true" showheader="true" tabtooverride="Case">
<models>
<model id="CasePhoto" limit="1" query="false" createrowifnonefound="true" sobject="skuid__Image__c">
<fields/>
<conditions/>
</model>
<model id="Case" limit="1" query="false" createrowifnonefound="true" sobject="Case">
<fields>
<field id="Subject"/>
<field id="Description"/>
@zachelrath
zachelrath / NewCaseWithMap.xml
Created March 12, 2014 18:17
Skuid Page XML for "NewCaseWithMap" example
<skuidpage showsidebar="true" showheader="true" tabtooverride="Case">
<models>
<model id="Case" limit="1" query="false" createrowifnonefound="true" sobject="Case">
<fields>
<field id="Subject"/>
<field id="Status"/>
<field id="Priority"/>
<field id="Latitude__c"/>
<field id="Longitude__c"/>
</fields>
@zachelrath
zachelrath / Sync PermissionSetAssignments with Custom Setting field
Created October 1, 2013 18:54
Skuid Snippets for adding/removing PermissionSetAssignments based on the value of a field in Custom Setting record(s)
// Row Action snippet
skuid.snippet.registerSnippet('SyncPermSets_RowAction',function(){
skuid.snippet.getSnippet('UpdatePermissionSetAssignmentsForUsers')({
rows:[arguments[0].item.row]
});
});
// Mass Action snippet
skuid.snippet.registerSnippet('SyncPermSets_MassAction',function(){
var rows = [];
@zachelrath
zachelrath / Multi-select Picklist renderer
Created October 1, 2013 15:40
Skuid custom field renderer to make any Field into a Multi-select Picklist
//
// SETTINGS
//
var POSSIBLE_PICKLIST_VALUES = [
'Education',
'College Counseling',
'Job Club',
'Full Medical & Dental Care',
'Mental Health',