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
Raghu_devRaghu_dev 

Static resource in a s-Control

Hi,

Can I use the static resource in a s-control ?

Like,
Code:
<script type="text/javascript" src="{!Resource.Companies}"> </script>

 
If no, is there a simpler way to use a .js file from the s-control. I have lot of functions defined in a .js file and I want to re-use them in multiple s-controls. Could someone pls let me know how I can do this.

Thanks


okaylah52okaylah52
Static resources are for Visualforce pages.

You can create s-controls of type Snippet and include them in your other s-control using the following format..

Code:
{!INCLUDE($SControl.Date_Chooser_Functions_js)} 

 
Hope this helps.