Wednesday, February 21, 2018

Load JS and CSS in Lightning Component from Static Resource

Suppose we have a ZIP file containing CSS and JS files, available under Static Resources (MIME Type : application/zip) and we want to load it in a lightning component, then check the code synapse needs to be update under .cmp file for solution ,

sample.zip - | sampleCss.css
                     | sampleJs.js


<aura:component>
 <ltng:require styles="{!$Resource.sample + '/sampleCss.css'}" 
                  scripts="{!$Resource.sample + '/sampleJs.js'}" 
                  afterScriptsLoaded="{!c.afterScriptsLoadedMethodInController}"/>
<aura:component>

Salesforce REST API: Upload a Files to a Record Attachments | Step-by-Step Guide

Uploading a file to a Salesforce record using the REST API is a straightforward process. In this tutorial, I'll walk you through the com...