Skip to content

Instantly share code, notes, and snippets.

@blackcappedchickadee
blackcappedchickadee / anon-apex-dump-dupe-fields-for-object.apex
Created July 27, 2018 20:58
Salesforce Anonymous apex that dumps a sorted list of duplicate fields and their API name.
//Anonymous apex that dumps a sorted list of duplicate fields and their API name.
//The output is sorted for *relatively* easy use.
final String SOBJECT_NAME_TO_ANALYIZE = 'Case'; //change this to your sObject you want to analyize.
//=================================================================================================================
Map<String, Schema.SObjectField> fieldMap = Schema.getGlobalDescribe().get(SOBJECT_NAME_TO_ANALYIZE).getdescribe().fields.getmap();
System.debug(LoggingLevel.Info,'fieldMap = ' + fieldMap);
@blackcappedchickadee
blackcappedchickadee / AngularTest-ApexController
Created January 9, 2015 21:13
Salesforce Visualforce page with AngularJS and Bootstrap connecting to an Apex Controller with @remoteaction methods - aka Javascript Remoting
public class AngularTestController {
@RemoteAction
public static Contact[] listContacts() {
return [select id, name, email from Contact Order By LastModifiedDate DESC LIMIT 200];
}
}