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
@RestResource( urlMapping = '/tesselservices/*' ) | |
global class TesselServices { | |
public static final String MODEL_ID = 'INSERT MODEL ID HERE'; | |
@HttpPost | |
global static String upload() { | |
RestRequest req = RestContext.request; | |
RestResponse res = Restcontext.response; | |
Blob picture = req.requestBody; |
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
.THIS label.slds-form-element__label { | |
display: none; | |
} | |
.THIS .fieldLabel { | |
font-size: .75rem; | |
} |
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
<design:component> | |
<design:attribute name="objectApiName" /> | |
<design:attribute name="fieldLabel" /> | |
<design:attribute name="fieldName" /> | |
<design:attribute name="selectedRecordId" /> | |
</design:component> |
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
({ | |
handleOnChange : function(component, event, helper) { | |
component.set( "v.selectedRecordId", event.getParams( "fields" ).value ); | |
} | |
}) |
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
<aura:component implements="lightning:availableForFlowScreens,flexipage:availableForRecordHome,force:hasRecordId" access="global"> | |
<aura:attribute name="objectApiName" type="String" access="public" /> | |
<aura:attribute name="fieldLabel" type="String" access="public" /> | |
<aura:attribute name="fieldName" type="String" access="public" /> | |
<aura:attribute name="selectedRecordId" type="String" access="public" /> | |
<lightning:recordEditForm objectApiName="{!v.objectApiName}"> | |
<label class="fieldLabel">{!v.fieldLabel}</label> | |
<lightning:inputField fieldName="{!v.fieldName}" onchange="{!c.handleOnChange}" /> | |
</lightning:recordEditForm> |
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
({ | |
getGiphyImage : function( emotion, callback ) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open( "GET", "https://api.giphy.com/v1/gifs/search?api_key=B9pfrx9wtMXmdLnVaJ6vllAW7uTqaHvO&q=" + emotion + "&limit=1", false ) | |
xhr.onreadystatechange = function() { | |
if( this.readyState === 4 ) { | |
var jsonResp = JSON.parse( this.response ); | |
var gifUrl = jsonResp.data[0].images.downsized.url; | |
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
({ | |
showEmotion : function(component, event, helper) { | |
var toneAnalyzeResponse = component.get( "v.toneAnalyzeResponse" ); | |
var standardTones = [ "joy", "sadness", "anger", "fear" ]; | |
var emotion; | |
for( var i = 0; i <= standardTones.length - 1; i++ ) { | |
if( toneAnalyzeResponse.indexOf( standardTones[i] ) !== -1 ) { | |
emotion = standardTones[i]; |
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
<aura:component implements="lightning:availableForFlowScreens" access="global"> | |
<aura:attribute name="toneAnalyzeResponse" type="string" access="global"></aura:attribute> | |
<aura:handler name="init" value="{!this}" action="{!c.showEmotion}"></aura:handler> | |
<aura:attribute name="gifUrl" type="string" access="private"></aura:attribute> | |
<aura:attribute name="detectedEmotion" type="string" access="private"></aura:attribute> | |
Detected Image: {!v.detectedEmotion} | |
<br/> | |
<img src="{!v.gifUrl}" /> | |
</aura:component> |
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
{ | |
"swagger" : "2.0", | |
"info" : { | |
"description" : "Shorten URL API", | |
"version" : "1.0.0", | |
"title" : "Bit.ly" | |
}, | |
"host" : "api-ssl.bitly.com", | |
"schemes" : [ "https" ], | |
"paths" : { |
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
PushTopic pt = new PushTopic(); | |
pt.Name = 'Announcements'; | |
pt.Query = 'SELECT Id, Name, Details__c FROM Announcement__c'; | |
pt.ApiVersion = 41.0; | |
pt.NotifyForOperationCreate = true; | |
pt.NotifyForOperationUpdate = true; | |
pt.NotifyForFields = 'Referenced'; | |
INSERT pt; |
NewerOlder