This project has been moved to https://github.com/weakish/gister
Please update your bookmark and git remote.
| import os | |
| import urllib | |
| import urllib2 | |
| import json | |
| import pprint | |
| # Grab credentials from the environment | |
| consumer_key = os.environ['CLIENT_ID'] | |
| consumer_secret = os.environ['CLIENT_SECRET'] | |
| username = os.environ['USERNAME'] |
| When looping through a set of Salesforce.com SObjects from a VisualForce page, you may want to test whether the SObject has any children without wrapping the SObjects in a wrapper class. Here's how: | |
| Controller: | |
| Create a property in the controller that is a map of the parent IDs and Boolean flag. | |
| public Map<Id, Boolean> hasChildren { | |
| get { | |
| if (this.hasChildren == null) { | |
| for (Parent__c parent : [select id, (select id from children__r) from parent__c]) { | |
| if (parent.children__r.size() > 0) { |
| <!-- This is an example of how to use the function --> | |
| <a id="Title_069Q00000006bam" href="javascript:showPreviewDialog('069Q00000006bam', 'Title_069Q00000006bam', 'PDF');">Cover Sheet</a> | |
| <!-- This is the javascript --> | |
| <script type="text/javascript"> | |
| function showPreviewDialogForContentDocument(contentDocumentId, titleElementId) { | |
| var query = "SELECT Id, ContentDocumentId, FileType, CreatedDate "; | |
| query += "FROM ContentVersion "; | |
| query += "WHERE ContentDocumentId = '" + contentId + "' "; |
| global with sharing class CPPBuilderRob { | |
| public CPPBuilderRob() { | |
| // Remember: @RemoteActions are static, hence controller has no state | |
| } | |
| @RemoteAction | |
| global static CPP_Report_Poller GetReportGroups(string opportunityId) { | |
| // Query from CPP_Report_Request__c |
This project has been moved to https://github.com/weakish/gister
Please update your bookmark and git remote.