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 ShortenURL{ | |
// Wrapper class for the Shorten URL JSON Response | |
public class ShortenURLWrapper { | |
public String kind; | |
public String id; | |
public String longUrl; | |
} | |
// Method to build the JSON Request and do callout |
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 GenerateJSON{ | |
// Method to generate the JSONBody for the List of accounts | |
public void GenerateJSONBody(List<Account> accList){ | |
// Instantiate the JSONGenerator class to access the method | |
JSONGenerator gen = JSON.createGenerator(true); | |
gen.writeStartObject(); // Writes the starting marker of JSON object - { | |
gen.writeFieldName('request'); // Writes the fieldName | |
gen.writeStartObject(); // Writes the starting marker of JSON object - { | |
gen.writeFieldName('customer'); |
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 ProbabilityController{ | |
public Opportunity thisOpp { get; set; } | |
public ProbabilityController(){ | |
thisOpp = new Opportunity(); | |
} | |
// Method the the Probability | |
// Called when the Stage Picklist is changed | |
public PageReference getProbability() { | |
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
<a href="/{!opp.id}" id="lookup{!opp.id}popup" onblur="LookupHoverDetail.getHover('lookup{!opp.id}popup').hide();" | |
onfocus="LookupHoverDetail.getHover('lookup{!opp.id}popup', '/{!opp.id}/m?retURL=/{!opp.id}&isAjaxRequest=1').show();" | |
onmouseout="LookupHoverDetail.getHover('lookup{!opp.id}popup').hide();" | |
onmouseover="LookupHoverDetail.getHover('lookup{!opp.id}popup', '/{!opp.id}/m?retURL=/{!opp.id}&isAjaxRequest=1').show();"> | |
{!opp.Name} | |
</a> |
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 SampleDatatable{ | |
/** | |
* On basis of field set, Create Dynamic SOQL | |
*/ | |
public List<Opportunity> getOpportunity() { | |
List<Schema.FieldSetMember> fsm = SObjectType.Opportunity.FieldSets.Opportunity_Field_Set.getFields(); | |
String query = 'SELECT '; | |
for(Schema.FieldSetMember f : fsm ) { | |
query += f.getFieldPath() + ', '; |
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 CaseTriggerHandler{ | |
@future(callout=true) | |
public static void checkSentiments( String caseId ){ | |
EinsteinAPI ea = new EinsteinAPI(); | |
Double positive; | |
Double negative; | |
Double neutral; | |
String result; | |
SentimentAnalysisResponse sar = new SentimentAnalysisResponse(); |
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
Sample Package.xml: | |
<?xml version="1.0" encoding="UTF-8"?> | |
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | |
<!-- Custom Object Tab, Web Tab and Visualforce tab --> | |
<types> | |
<members>Employee__c</members> | |
<name>CustomTab</name> | |
</types> | |
<types> |