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
global with sharing class WellnessTrackerController { | |
@RemoteAction | |
global static List<WellnessRank> getWeeklyRanking() { | |
List<WellnessRank> rankList = new List<WellnessRank>(); | |
/* | |
* Not sure why, but needed to alias the relationship fields | |
* http://salesforce.stackexchange.com/questions/19381/reference-fields-on-parent-object-in-aggregate-query | |
*/ |
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
var activity = new RemoteObjectModel.Wellness_Activity__c(); | |
activity.set('Wellness_Goal__c', goal.Id); | |
activity.set('User__c', userId); | |
activity.create(function(error, result, event) { | |
if (error != null) { | |
alert(error); | |
} else { | |
alert('Activity logged successfully!'); | |
} | |
}); |
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:remoteObjects jsNamespace="RemoteObjectModel"> | |
<apex:remoteObjectModel name="Wellness_Goal__c" fields="Id,Name,Points__c,Active__c"/> | |
<apex:remoteObjectModel name="Wellness_Activity__c" fields="Id,Wellness_Goal__c,User__c"/> | |
</apex:remoteObjects> |
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
public class Criteria | |
{ | |
public String objectType {get;set;} | |
public String fieldName {get;set;} | |
@TestVisible private transient Schema.DescribeFieldResult describeResult | |
@TestVisible private String Schema.sObjectField schemaField; | |
/* Other methods that leverage the fields describe to determine things like whether its a picklist, | |
what picklist values are available, etc... */ |
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
public class Criteria | |
{ | |
public String objectType {get;set;} | |
public String fieldName {get;set;} | |
// The following will fail when the page tries to serialize it into the view state unless it is set as transient | |
@TestVisible private String Schema.DescribeFieldResult describeResult; | |
/* Other methods that leverage the fields describe to determine things like whether its a picklist, | |
what picklist values are available, etc... */ | |
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" tabStyle="Contact" extensions="ContactWithAccountAttachmentsController"> | |
<apex:detail inlineEdit="true"/> | |
<apex:pageBlock title="Account Attachments"> | |
<apex:pageBlockTable value="{!noteAttachments}" var="n" rendered="{!noteAttachments.size > 0}"> | |
<apex:column headerValue="Type" value="{!n.Type}"/> | |
<apex:column headerValue="Title"> | |
<apex:outputLink value="/{!n.Id}" title="{!n.Name}" target="_self">{!n.Name}</apex:outputLink> | |
</apex:column> | |
<apex:column headerValue="Last Modified" value="{!n.LastModifiedDateString}"/> | |
<apex:column headerValue="Created By" value="{!n.OwnerName}"/> |
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 controller="testLookup"> | |
<apex:form > | |
<apex:pageBlock id="incomeBlock" mode="edit"> | |
<apex:pageBlockSection columns="1"> | |
<apex:pageBlockTable value="{!opptys}" var="t"> | |
<apex:facet name="footer"> | |
</apex:facet> | |
<apex:column headerValue="Id"> | |
<apex:outputField value="{!t.Id}"/> | |
</apex:column> |
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
public class testLookup | |
{ | |
public List<Opportunity> opptys {get;set;} | |
public testLookup() | |
{ | |
opptys = new List<Opportunity>(); | |
opptys.add(new Opportunity()); | |
} | |
} |