This file contains hidden or 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 RecentRecordsController { | |
@AuraEnabled public static List<sobject> getRecentRecords(String ObjectName,String limits,String fieldstoget){ | |
List<Id> recentlyViewedIds = new List<Id>(); | |
Integer limitofRecord = Integer.valueOf(String.escapeSingleQuotes(limits)); | |
for(sObject obj : [Select Id from RecentlyViewed where Type =:String.escapeSingleQuotes(ObjectName)]){ | |
recentlyViewedIds.add(obj.Id); | |
} | |
String queryString = 'Select '+ String.escapeSingleQuotes(fieldsToGet)+ |
This file contains hidden or 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
<div class="slds-card"> | |
<header class="slds-card__header"> | |
<div class="slds-media slds-media--center"> | |
<div class="slds-media__figure"> | |
<div aura:id="svg_today"> | |
<![CDATA[<svg aria-hidden="true" class="slds-icon slds-icon--small slds-icon-text-default"> | |
<use xlink:href="/resource/SLDS080/assets/icons/action-sprite/svg/symbols.svg#priority"></use> | |
</svg>]]> | |
</div> | |
</div> |
This file contains hidden or 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
getFitbitData : function(component) { | |
var action = component.get("c.getUserDetails"); | |
action.setCallback(this,function(response){ | |
var state = response.getState(); | |
if(state === 'SUCCESS'){ | |
var parseJson = JSON.parse(response.getReturnValue()); | |
component.set("v.User",parseJson.user); | |
}else if (state === "ERROR") { | |
console.log('Error'); | |
} |
This file contains hidden or 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
@AuraEnabled public static string getUserDetails() { | |
HttpRequest req = new HttpRequest(); | |
Http http = new Http(); | |
req.setMethod('GET'); | |
req.setEndpoint('callout:Fitbit/1/user/-/profile.json'); | |
HttpResponse res = http.send(req); | |
return res.getBody(); | |
} |
This file contains hidden or 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 showHeader="true" sidebar="true" docType="html-5.0" standardStylesheets="false"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
//Tooling API query to get the overall code coverage | |
$.ajax('/services/data/v30.0/tooling/query/?q=SELECT PercentCovered FROM ApexOrgWideCoverage', | |
{ | |
beforeSend: function(xhr) { | |
xhr.setRequestHeader('Authorization', 'Bearer {!$Api.Session_ID}'); |
This file contains hidden or 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> | |
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"/> | |
<script> | |
jQuery(document).ready(function($) { | |
// Pull 10 Contacts via the REST API | |
$.ajax('/services/data/v28.0/query?q=SELECT+Name+FROM+Contact+LIMIT+10', | |
{ | |
beforeSend: function(xhr) { | |
// Set the OAuth header from the session ID | |
xhr.setRequestHeader('Authorization', 'Bearer {!$Api.Session_ID}'); |
This file contains hidden or 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
// Check to see if person accounts are enabled. | |
public Boolean personAccountsEnabled() | |
{ | |
// Describe the Account object to get a map of all fields | |
// then check to see if the map contains the field 'isPersonAccount' | |
return Schema.sObjectType.Account.fields.getMap().containsKey( 'isPersonAccount' ); | |
} |
This file contains hidden or 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
trigger DuplicateCheck on Account (before insert,before update) { | |
for(Account acc: Trigger.New) | |
{ | |
Map<String, Object> params = new Map<String, Object>(); | |
params.put('varAccountName',acc.Name); | |
params.put('varAccountId',acc.Id); | |
Flow.Interview.DuplicateAccountCheck duplicateAccountCheck = new Flow.Interview.DuplicateAccountCheck(params); | |
duplicateAccountCheck.start(); |
This file contains hidden or 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
// to turn ON the Assignment Rules in Apex | |
Database.DMLOptions dmlOptn = new Database.DMLOptions(); | |
dmlOptn.assignmentRuleHeader.useDefaultRule = true; | |
leadObj.setOptions(dmlOptn); |
This file contains hidden or 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
AmCharts.makeChart("chartdiv", | |
{ | |
"type": "gauge", | |
"theme": "light", | |
"arrows": [ | |
{ | |
"id": "GaugeArrow-1" | |
}, | |
{ | |
"id": "GaugeArrow-2" |