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
{ | |
"clientId": "lxdl9o32njygi1gj47kgfaga4k", | |
"data": { | |
"event": { | |
"createdDate": "2018-04-11T09:34:50.694Z", | |
"replayId": 4, | |
"type": "updated" | |
}, | |
"sobject": { | |
"PackageType__c": "BEST_BEFORE_DATE", |
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
PushTopic pushTopic = new PushTopic(); | |
//Channel Name | |
pushTopic.Name = 'ProductUpdates'; | |
//Define the query which will be used to create the payload | |
pushTopic.Query = 'SELECT Id, SKU__c, PackageType__c, ShelfLife__c FROM E_Product__c | |
pushTopic.ApiVersion = 42.0; |
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
/** | |
These scripts will only work in Salesforce classic. | |
**/ | |
//For Edit access column | |
var arrayEdit = document.getElementsByClassName('displayedCol'); | |
for(i=0;i<arrayEdit.length;i++){ | |
if(arrayEdit[i]['firstElementChild']!= undefined) | |
arrayEdit[i]['firstElementChild'].checked = true; | |
} |
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
String key = 'hgdhdhhdjfh12ehsn'; | |
String secret = 'DNf32sdsj747dhkjd8893jjjdjds7jjk'; | |
//Generating current Unix timestamp (in seconds) | |
String getTime = string.valueOf(Datetime.Now().getTime()/1000); | |
String requestInput = key + secret + getTime; | |
Blob requestBlob = Blob.valueOf(requestInput); | |
Blob hash = Crypto.generateDigest('MD5', requestBlob); | |
//Need to convert into hex to generate the equivalent of md5(string) method of PHP. |
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 variables | |
$projects:{}, | |
$employees: {}, | |
$manager: {}, | |
doInit : function(cmp) { | |
this.$projects = this.initAutoComplete(cmp, 'projects', ["Project1", "Project2", "Project3"]); | |
this.$employees = this.initAutoComplete(cmp, 'employees', ["Emp1", "Emp2", "Emp3"]); |
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 > | |
<apex:includescript value="/soap/ajax/20.0/connection.js"/> | |
<apex:includescript value="/soap/ajax/24.0/apex.js"/> | |
<apex:includeScript value="https://code.jquery.com/jquery-2.2.1.min.js" /> | |
<script> | |
sforce.connection.sessionId = '{!$Api.Session_ID}'; | |
var layout, recordTypeMap; | |
FinalResult = new Array(); |
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="Account"> | |
<apex:repeat value="{!Account.contacts}" var="con"> | |
<apex:outputPanel html-did="{!con.Id}" onclick="console.log(this.getAttribute('did'));"> | |
{!con.firstName} <br /> | |
</apex:outputPanel> | |
</apex:repeat> | |
</apex:page> | |
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="chatterHacksController" standardStylesheets="false" showHeader="false"> | |
<!-- Placeholder to instantiate the chatter methods on page. -> | |
<div style="display:none"> | |
<chatter:follow entityId="00590000004OupA" /> <br /> | |
</div> | |
<c:ChatterFollow entityId="00590000004OupA" networkId="000000000000000" activityType="unfollow"/> | |
<c:ChatterFollow entityId="00590000004OupA" networkId="000000000000000" activityType="unfollow"/> | |
<c:ChatterFollow entityId="00590000004OupA" networkId="000000000000000" activityType="unfollow"/> | |
</apex:page> |
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:component> | |
<apex:attribute name="entityId" type="string" description="This would be Id of User/Record which need to be followed" required="true"/> | |
<apex:attribute name="networkId" type="string" description="This would be the Id of the network in which the container page would be running" required="true"/> | |
<apex:attribute name="activityType" type="string" description="To render the right block on load based on entity is already followed or not" required="true"/> | |
<div class="zen"> | |
<!-- Two important params here which would be dynamic based on context and usage | |
1. data-sfdc-entity-id: This need to be set as User/Record Id which need to be follow/un-follow |