Skip to content

Instantly share code, notes, and snippets.

@zachelrath
Created March 25, 2014 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachelrath/9773392 to your computer and use it in GitHub Desktop.
Save zachelrath/9773392 to your computer and use it in GitHub Desktop.
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"/>
<field id="skuid__Photo__r.Name"/>
<field id="skuid__Photo__r.skuid__AttachmentId__c"/>
</fields>
<conditions>
<condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
</conditions>
</model>
<model id="Attachments" limit="100" query="true" createrowifnonefound="false" sobject="Attachment">
<fields>
<field id="ContentType"/>
<field id="BodyLength"/>
<field id="Name"/>
<field id="Description"/>
</fields>
<conditions>
<condition type="modelmerge" value="" field="ParentId" operator="=" model="Case" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
</conditions>
</model>
<model id="CaseComments" limit="100" query="true" createrowifnonefound="false" sobject="CaseComment">
<fields>
<field id="CommentBody"/>
<field id="CreatedDate"/>
</fields>
<conditions>
<condition type="modelmerge" value="" field="ParentId" operator="=" model="Case" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
</conditions>
</model>
</models>
<components>
<pagetitle model="Case">
<maintitle>{{#CaseNumber}}{{CaseNumber}}{{/CaseNumber}}{{^CaseNumber}}You do not have permission to view this Case.{{/CaseNumber}}</maintitle>
<subtitle>
<template>{{Model.label}}</template>
</subtitle>
<actions/>
</pagetitle>
<panelset type="standard">
<panels>
<panel width="300" type="right">
<components>
<file editable="true" storeas="field" displayas="image" deleteable="false" model="Case" defaultimage="org" idfield="skuid__Photo__c" label="Case Photo"/>
</components>
</panel>
<panel>
<components>
<basicfieldeditor showsavecancel="false" showheader="true" model="Case" mode="read">
<columns>
<column width="50%">
<sections>
<section title="Basics">
<fields>
<field id="CaseNumber"/>
<field id="Subject"/>
<field id="Description"/>
</fields>
</section>
</sections>
</column>
<column width="50%">
<sections>
<section title="System Info">
<fields>
<field id="CreatedDate"/>
<field id="Status"/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
</panel>
</panels>
</panelset>
<tabset rememberlastusertab="true" defertabrendering="true">
<tabs>
<tab name="Upload Files">
<components>
<file storeas="record" displayas="filename" model="Case" label="Upload some STUFF"/>
<skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Attachments" buttonposition="" mode="read">
<fields>
<field id="Name"/>
<field id="BodyLength"/>
<field id="ContentType"/>
<field id="Description"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
</tab>
<tab name="Case Comments" loadlazypanels="true">
<components>
<skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="CaseComments" buttonposition="" mode="read">
<fields>
<field id="CommentBody"/>
<field id="CreatedDate"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
</tab>
</tabs>
</tabset>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
</skuidpage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment