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
/* | |
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 |
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
/* | |
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 |
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
{ | |
"ApexClass": [ | |
"NamespacePrefix" | |
], | |
"ApexPage": [ | |
"Id", | |
"Name" | |
], | |
"CollaborationGroup": [ | |
"CollaborationType", |
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
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 |
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
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} /> |
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
@RemoteAction | |
global static boardInfoWrapper toggleFollowTask(string taskId){ | |
//Find if there is a current record | |
//Need to use without sharing | |
List<EntitySubscription> existingList = trControllerWithoutSharing.queryWithoutSharing('Select e.SubscriberId, e.ParentId From EntitySubscription e WHERE e.SubscriberId=\''+String.escapeSingleQuotes(UserInfo.getUserId())+'\' AND e.ParentId=\''+String.escapeSingleQuotes(taskId)+'\' LIMIT 1000'); | |
//If no, insert a new one | |
if(existingList.size()==0){ | |
EntitySubscription follow = new EntitySubscription (parentId = taskId,subscriberid = UserInfo.getUserId()); | |
Map<String, Schema.SObjectField> fields = Schema.SObjectType.EntitySubscription.fields.getMap(); | |
if(fields.get('NetworkId')!=null){ |
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
<!-- include this fella --> | |
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'></script> | |
<script> | |
//Call whenever you do something that results in a frame resize, and probably on load | |
function resizeIframe(){ | |
var containerHeight = document.getElementById('checklist-container').clientHeight; | |
Sfdc.canvas.publisher.resize( {height : containerHeight+'px'}); | |
} | |
</script> |
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
Schema.DescribeSObjectResult d = Schema.getGlobalDescribe().get('Task').getDescribe(); | |
Map<String,sObjectField> fields = d.fields.getMap(); | |
for (String f : fields.keyset() ) { | |
Schema.DescribeFieldResult dfr = fields.get(f).getDescribe(); | |
//system.debug(JSON.serialize(dfr)); | |
system.debug(dfr.Name); | |
} |
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
<script> | |
document.addEventListener('DOMContentLoaded', pageFullyLoaded, false); | |
function pageFullyLoaded(){ | |
var body = document.body, | |
html = document.documentElement; | |
var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ); | |
alert(height); | |
Sfdc.canvas.publisher.resize( {height : height+'px'}); | |
} | |
</script> |
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
if (!showWarning(this)) return false;bannerText=null;;A4J.AJAX.Submit('j_id0:j_id12',event,{'similarityGroupingId':'j_id0:j_id12:objectTable:213:j_id25','parameters':{'j_id0:j_id12:objectTable:213:j_id25':'j_id0:j_id12:objectTable:213:j_id25'} } ) |