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
// Query list of Accounts | |
List<Account> accounts = [ | |
SELECT | |
Id, Name | |
FROM | |
Account | |
]; | |
// get Set of Ids of the Object | |
Set<Id> ids = new Set<Id>(new Map<Id, Account>(accounts).keySet()); |
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
trigger BatchApexErrorTrigger on BatchApexErrorEvent (after insert) { | |
List<BatchLeadConvertErrors__c> List_LeadConvertError = new List<BatchLeadConvertErrors__c>(); | |
for(BatchApexErrorEvent event: trigger.new){ | |
BatchLeadConvertErrors__c lcerror = new BatchLeadConvertErrors__c(); | |
lcerror.AsyncApexJobId__c = event.AsyncApexJobId; | |
lcerror.Records__c = event.JobScope; | |
lcerror.StackTrace__c = event.StackTrace; | |
List_LeadConvertError.add(lcerror); |
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
ID recordId = '5001a00000CgCE2'; | |
DescribeSObjectResult describeResult = recordId.getSObjectType().getDescribe(); | |
List<String> fieldNames = new List<String>( describeResult.fields.getMap().keySet() ); | |
String query = | |
' SELECT ' + | |
String.join( fieldNames, ',' ) + | |
' FROM ' + |
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
public class S1Reporting { | |
/* | |
* @see Salesforce1 Reporting REST API Developer Guide | |
*/ | |
public class GetAnalyticsReportsResponseBody { | |
@AuraEnabled | |
public String name; | |
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
aadu => ado | |
aaliyah => aleaseya, alea, aliya, aliyah, allyiah, alia, aleeya, aleah | |
aaron => arron, aron, ahron | |
aarti => arti | |
aayesha => ayesha, ayasha, ayse, ayisha | |
aba => abod, abony, abos | |
abagail => abbe, abby, abbie, abilio, gail, abbey, abigale, abigail, abihail, abigayle | |
abba => abbot, abbott, absa, abbe | |
abbe => abba, abbot, abbott, absa, abbey, abby, abigail, abihail, abagail, abigayle, abilio, gail, abigale, abbie | |
abbey => abbe, abilio, gail, abigale, abigail, abihail, abagail, abigayle, abbie, abby |
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
<cfscript> | |
/** | |
* queryToCsv | |
* Allows us to pass in a query object and returns that data as a CSV. | |
* This is a refactor of Ben Nadel's method, http://www.bennadel.com/blog/1239-Updated-Converting-A-ColdFusion-Query-To-CSV-Using-QueryToCSV-.htm | |
* @param {Query} q {required} The cf query object to convert. E.g. pass in: qry.execute().getResult(); | |
* @param {Boolean} hr {required} True if we should include a header row in our CSV, defaults to TRUE | |
* @param {String} d {required} Delimiter to use in CSV, defaults to a comma (,) | |
* @return {String} CSV content | |
*/ |
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
<!--- suppose your query you did with cfquery is stored in the variable myQuery ---> | |
<script> | |
var q = #SerialzeJSON(myQuery,true)#; | |
// make an easy to use object | |
var newQuery = queryToObject(q); | |
console.log(newQuery); | |
</script> |
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
curl -XGET 'http://127.0.0.1:9200/test/member/_search?pretty=1' -d ' | |
{ | |
"query" : { | |
"filtered" : { | |
"filter" : { | |
"and" : [ | |
{ | |
"term" : { | |
"birthday" : "1970-10-24" | |
} |
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
curl -XGET 'http://127.0.0.1:9200/test/member/_search?pretty=1' -d ' | |
{ | |
"query" : { | |
"bool" : { | |
"should" : [ | |
{ | |
"text" : { | |
"first_name" : { | |
"boost" : 1, | |
"query" : "rob smith" |
NewerOlder