Skip to content

Instantly share code, notes, and snippets.

View cdeckert's full-sized avatar

Christian Deckert cdeckert

View GitHub Profile
public static Map<String, ID>recordType{ get {
if( recordType== null )
{
recordType = new Map<String, Id>();
for(RecordType r : [Select r.SobjectType, r.Id, r.DeveloperName From RecordType r])
{
recordType.put(r.SobjectType+':'+r.DeveloperName, r.id);
}
}
return recordType;
public List<TrialManagement__c> getSelectedRecords()
{
if(checked != null && checked)
{
return new List<TrialManagement__c>{record};
}
return null;
}
@cdeckert
cdeckert / gist:3217359
Created July 31, 2012 14:22
jQuery Example - Virgina
<!doctype html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
var controlCheckboxes = function()
{
if(jQuery(this).is(':checked'))
<select class="title required" id="WebKontaktTelefon2:AkademieSiteTemplate:WebmainHeader2:WebmainHeader2Cmp:WebKontaktTelefon:WebKontaktTelefonCmp:form:salutation" name="WebKontaktTelefon2:AkademieSiteTemplate:WebmainHeader2:WebmainHeader2Cmp:WebKontaktTelefon:WebKontaktTelefonCmp:form:salutation"><option value="">– Keine –</option><option value="Herr">Herr</option>
<option value="Frau">Frau</option>
</select>
var inputData = {
"groups": [
{
"trail": "a002000000Ep07J",
"adults": "2",
"children": "3"
},
{
"trail": "a002000000Ep07K",
"adults": "4",
# | Setup | Develop | Pages
# VertragNewButton
# -> Clone
# Label << "ObjectName"+ NewButton und Name << Label
# StandardController ersetzen durch API Name von Object
# Save
# | Setup | Create | Objects
# Object Auswählen
# -> Standard Buttons and Links ->Edit New
@cdeckert
cdeckert / gist:4030447
Created November 7, 2012 09:45
Auto Populate fields while creating a new record in Salesforce
public class SObjectFillNameController
{
ApexPages.StandardController stdController;
public SObjectFillNameController(ApexPages.StandardController controller) {
stdController = controller;
stdController.getRecord();
}
public PageReference redirect()
{
@cdeckert
cdeckert / gist:4030458
Created November 7, 2012 09:47
Auto Populate fields while creating a new record in Salesforce / Visualforce
<apex:page standardController="MyObject__c" extensions="SObjectFillNameController" action="{!redirect}"></apex:page>
@cdeckert
cdeckert / gist:4123959
Created November 21, 2012 09:25
Massdelete related List Records
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")}
var records = {!GETRECORDIDS( $ObjectType.Region_Holiday__c )}; // API Record Name
if (records[0] == null) {
alert("Please select at least one record.") }
else {
var errors = [];
@cdeckert
cdeckert / gist:4160498
Created November 28, 2012 10:56
Dropdowns Fox
[
{
"label": "Werbung", "value": "Werbung",
"related":
[
{
"label" : "- keine -",
"value" : ""
},
{