Skip to content

Instantly share code, notes, and snippets.

View mtetlow's full-sized avatar

Mike "Mikename" Tetlow mtetlow

View GitHub Profile
var WrappedCalendar = React.createClass({
mixins:[
require('react-onclickoutside'),
],
handleClickOutside: function(e){
this.props.hideDatePicker();
},
render: function(){
return(
<Calendar value={this.props.deadlineDate} onChange={this.props.dateChanged} footer={true} />
sObject sObj = Schema.getGlobalDescribe().get('Account').newSObject();
sObject sObj2 = Schema.getGlobalDescribe().get('Account').newSObject();
List<sObject> sObjList = new List<sObject>();
sObjList.add(sObj);
sObjList.add(sObj2);
List<Account> accountList = (List<Account>)sObjList;
upsert accountList;
//Results in
System.TypeException: DML on generic List only allowed for insert, update or delete
{
"ApexClass": [
"NamespacePrefix"
],
"ApexPage": [
"Id",
"Name"
],
"CollaborationGroup": [
"CollaborationType",
/*
Copyright (c) 2015, salesforce.com, inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
/*
Copyright (c) 2015, salesforce.com, inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
@mtetlow
mtetlow / OpportunityDependencies.app
Last active July 12, 2018 21:05
Using a TaskRay Lightning Component in Aloha
<aura:application access="GLOBAL" extends="ltng:outApp">
<aura:dependency resource="TASKRAY_LTNG:trProjectStatusBar"/>
</aura:application>
<apex:page standardController="TASKRAY__Project__c">
<script src="/apex/dsfs__DocuSign_JavaScript" />
<input class="btn" type="button" id="docusignActionLink" value="Send with DocuSign" />
<script>
var recordId = '{!TASKRAY__Project__c.Id}';
var sendToDocuSign = function(){
var url = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID="+recordId;
var win = window.open(url, '_blank');
win.focus();
}
<aura:component implements="forceCommunity:availableForAllPageTypes,flexipage:availableForAllPageTypes,force:hasRecordId" controller="trTestCtrl" access="global">
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="testStr" type="String" default="default value" />
<div>{!v.testStr}</div>
</aura:component>
@mtetlow
mtetlow / lockerMutationReproTest.cmp
Created October 25, 2016 20:46
Object Mutation with Locker Service enabled
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
<aura:attribute name="lockedObj" type="Object" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<button onclick="{!c.addAtributeViaMutation}">Add Attribute via mutation then simple set</button>
<button onclick="{!c.addAtributeDeepSet}">Add Attribute via deep set</button>
<button onclick="{!c.log}">Log</button>
<div>Existing Attribute: {!v.lockedObj.existingAttribute}</div>
<div>New Attribute via mutation: {!v.lockedObj.newAttribute}</div>
<div>New Attribute via deep set: {!v.lockedObj.newAttributeDeep}</div>
</aura:component>
<aura:application >
<c:simpleRecordEdit />
</aura:application>