function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
stephenystepheny 

how to leverage static resource in scontrol?

Suppose I have a js file in static resource.
How can I reference it in the scontrol
 
 
Thanks in advance
 
ArtabusArtabus
Something like this for VisualForce pages : {!$Resource.MyResourceFile}
but it does not seem to work in SControls.
You could try something not supported like this :
soofsoof
Upload your JS file to Salesforce.com as a Document.  Select the Document, and get the URL in the "Click here to view this file" link.  Put this URL in the Script tag's src attribute.
Code:
<script type="text/javascript" src="/servlet/servlet.FileDownload—file=015T00000006xxx"></script>


Please make sure that you make this document viewable to all uers that are going to access this S-Control.  Also, the user's profile must have Read permissions on Document object.  I hope this helps.

Thanks.