Questions tagged [static-resources]

Static resources allow you to upload content that you can reference in a Visualforce page, including archives (such as .zip and .jar files), images, stylesheets, JavaScript, and other files.

64 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
2answers
2k views

Dynamic reference to static resource in lightning component

In lightning, we can reference to static resource by a value provider like: <img src="{!$Resource.staticResource}"/> Is there any smart way to make it dynamic like: <aura:attribute name="...
4
votes
0answers
330 views

Uncaught TypeError: r[o].hasOwnProperty is not a function when trying to use a Static Resource

I'm currently working on a Lightning Component that needs a third party library when the library is loaded I get this error Uncaught TypeError: r[o].hasOwnProperty is not a function throws at /...
4
votes
0answers
74 views

Including javascript in the top level window of Service Cloud

I'm working on an integration project that requires showing the Service Cloud from a .NET control. That control generally communicates via a javascript object on the top level window. The problem I'm ...
3
votes
1answer
169 views

Error when loading custom font in Community - 500 (Internal Server Error)

I've set up the fonts to load exactly as specified in https://developer.salesforce.com/docs/atlas.en-us.communities_dev.meta/communities_dev/communities_dev_customize_font.htm and they work most of ...
3
votes
2answers
2k views

uploaded zip files changing Mime type to application/octet-stream in static resources

I'm trying to upload a zip file in static resources. Even after selecting a .zip file to upload , the uploaded document is displaying mime type as application/octet-stream instead of application/zip. ...
3
votes
0answers
176 views

LockerService causes access error when managed package component tries to load js from its static resource

I turned on LockerService to test our Lightning components and I get the following error when loading a page. Our component is trying to load a .js file from its own static resource and it throws the ...
3
votes
1answer
236 views

Is it possible to include js files from static resources into listview onclick JS button?

Is it possible to include js files from static resources into listview onclick JS button? REQUIRESCRIPT can't be used anymore for static resources because of this Known Issue that won't be fixed. The ...
3
votes
0answers
413 views

Is it possible to include a Mustache.js Template saved to a Static Resource within a VisualForce Page?

My VisualForce page includes the following Mustache.js template code: <script id="template" type="x-tmpl-mustache"> <tr><td>{{LastName}}</td><td>{{FirstName}}</td&...
2
votes
0answers
32 views

Issue to push static resource (single files and zip) using SFDX

have any of you faced issues to push static resources to scratch orgs using SFDX v46.8.0? Asking because I faced this issue and had to revert back salesforcedx plugin to 46.6.0. path\singleFile....
2
votes
0answers
30 views

Javascript in Static Resources for security review but requires parameter

I have a package that was submitted for security review which requires JS to be in static resources. Required: all script and style resources must be loaded through static resources Do not load ...
2
votes
0answers
116 views

Include static resource with ltng:require as it is

Let us start with the problem description. I am trying to incorporate d3.js into my Salesforce component. Here is the error I am getting: Uncaught TypeError: Cannot read property 'document' of ...
2
votes
0answers
552 views

Access static resource image in lightning markup img tag

I have done my research on this and the solution is not working for me. Quick problem statement. I have Myresource that is uploaded as static resource. I am trying to access images under this in img ...
2
votes
2answers
197 views

Loading HTTP resource in Visualforce pages

Is there a way to allow loading of non secure resources from external sites in Visualforce pages? Below is the scenario I have. I am creating a force.com site page. The template I received for the ...
1
vote
0answers
23 views

Alternatives to Static Resource

Our org has exhausted the limit of static resources. Mostly used in storing badge images for the certifications and exposed as a downloadable URL on customer community. I want to remove these images/...
1
vote
0answers
38 views

How to use static resource image in visualforce email template editor

I am using a public site and a public static resource to add images to a visualforce email template. But when I use this code: <img src="http://example.force.com/email/{!$Resource.logo_300}" ...
1
vote
0answers
396 views

Invalid reference of Static Resource in LWC Salesforce

I am trying to use Static resource inside the lightning web component. while importing getting this error:- "Invalid reference SDFCImages of type resourceUrl in file StaticResourceDemo.js" here how ...
1
vote
0answers
195 views

Alternative to custom settings in salesforce

I have a problem statement where I need to store a list of some 40 Parent Objects Ids statically. Further, if any one of the Parent Object's child records goes higher then 45,000(which is calculated ...
1
vote
1answer
230 views

Static resources unavailable when the community website is disabled

We have a public static resource Portal_bundle that contains the JS & CSS that is used on the community website The same static resource is used in a custom maintenance page that is displayed ...
1
vote
0answers
464 views

Static resource in lightning component

My zip file name is APIAI, it contains ApiAi.js. Path for that file is /APIAI/ApiAi.js I have uploaded it as static resource with name as chatbotApi and referring it in lightning component as ...
1
vote
0answers
23 views

Loading resources dynamically with a link or script tag for google chart allowed?

Our App did not pass the App Exchange security review because of the following issue JS not in Static Resource For jquery and datatables there is a officially accepted source file to load data ...
1
vote
0answers
29 views

Different community paths in different environments

I have different URL's in my sandbox and in my production environment. It is causing problems with my static resources in the css files. In my sandbox the community url is https://mydomain.com/...
1
vote
1answer
833 views

Problem with static resource and Lightning Component

I am trying to use JQuery DataTables Library in a Lightning Component but I am finding problems with static resources. I upload three static resources (versions as DataTables Documentation): jQuery ...
1
vote
0answers
257 views

Static resource won't refresh

I have a static resource with is a Javascript file of about 1mb. After successfully uploading the file, and clearing the cache of the page that uses the static resource, it's still using the old ...
1
vote
0answers
151 views

View a PDF and TXT file from within an HTML static resource

So i have created a website in pure HTML 5, with some css's, jquery's and modals and locally on my PC it's all working great. I have some PDF and TXT files that i want to be able to view and it's ...
1
vote
0answers
630 views

Bootstrap static resource is not applying to page

This is the VF page I am trying to style <apex:page showHeader="true" sidebar="false" controller="ComposeEmailController"> <apex:stylesheet value="{!URLFOR($Resource.bootstrap, 'sf-bootstrap/...
1
vote
1answer
77 views

How to make org “tour”?

Can anyone give guidance on how to implement something like http://usablica.github.io/intro.js/ in a salesforce org? WalkMe is not an option, but trying to achieve something similar. To make my ...
1
vote
0answers
102 views

Mavensmate - Deploy only changes to static resource

I am currently having trouble with deploying static resource using mavensmate. I have a static resource with a lot of images. But the only thing I'm changing is the CSS and every time I deploy the ...
1
vote
1answer
129 views

Static resource naming convention

Is it a good practice to include version information along with the name when you are uploading a static resource. For example, I am uploading a file "Bootstrap-3.3.5.zip" in static resource, Shall I ...
1
vote
1answer
89 views

javascript in static resource

I have written a javascript function whose purpose is to open a case in a primary tab.The idea is to access this function in VF Page through but i'm unable to do it.When i'm opening the page microsoft ...
1
vote
0answers
215 views

Lightning - static resource deployment - javascript code

I am using the migration tool to deploy javascript files containing logic to display charts in a lightning component. To test my code I need to set the chrome developer console to not cache files to ...
1
vote
1answer
22 views

Querying particular static resource from complete pages in Org

I need to check for a particular resource in different VF pages.Normal method will be opening each page and checking for the static resource(Image/JS files) but is there any other probable method ?? ...
1
vote
0answers
166 views

Comparison/diff tool for the files in static resources with in eclipse

Is there any tool which compares the differences between the previous file and the current file in the static resources. Static resources have many files and many people are working on it. We need a ...
0
votes
1answer
91 views

Error on browser resize after using JQuery in a LWC

I am porting an existing app that uses JQuery to insert HTML into a Lightning Web Component when it is sent a formId via pubsub from another Aura or LW Component. The sfEnv object is for sharing data ...
0
votes
0answers
68 views

Display blob value in VF page and render as PDF

I am trying to display a PDF stored in static resource and passing the blob as a string to VF page and late rendering as PDF <apex:page controller="DataDisplayController" renderAs="pdf"> {!...
0
votes
1answer
13 views

Static resource not able to access global merged fields

{!$Component.idPageTestCase.idForm.idFocusedTab} This works well when it is there in Javascript tag inside visualforce page, but fails when the Javascript is moved to a static resource and the static ...
0
votes
1answer
26 views

Community header script - when is it loaded

Using lightning components, we want to load a script in our community from a third party. I put that script in a static resource, and now I need to be able to use it. Script: window.myScript = ...
0
votes
1answer
206 views

Web Component can't find variable `require`

I am trying to use the json2csv javascript package in my Salesforce Web Component, but I get the error: can't find variable 'require'. I've uploaded the json2csv package as a static resource and am ...
0
votes
0answers
29 views

No functions defined in JS files in a zip file uploaded as a Static Resource

I am attempting to use the D3 JavaScript library in a Web Component, but am having issues getting any method to work. I have downloaded the d3.zip file from the link above, and have attempted to ...
0
votes
0answers
68 views

Unable to upload static resources to sandbox

i have a sandbox on salesforce and i am pushing code there to test. i am also using some static resources which i have uploaded there. But this morning, when i tried to edit a static resource, i am ...
0
votes
1answer
498 views

How to use Salesforce Sans font in lightning component?

I have uploaded the Salesforce Sans font as satic resource in my dev org. How to use this sytle in my lightning component. <lightning:layout multipleRows="true"> <lightning:layoutItem ...
0
votes
2answers
378 views

How to call html content stored in static resource in lightning component?

I have a requirement where I need to store all the footer content(.html files) in static resource and use that in lightning component. I didn't find any documents where we can use the html content ...
0
votes
2answers
102 views

Static Resource fails to load on Child Component

I have the following parent component, child component, and static resource: //ParentComponent <aura:component extensible="true"> </aura:component> //ChildComponent <aura:component ...
0
votes
1answer
152 views

Image from static resource not working in formula

I have few images (Star01, Star02...etc) Which i clubbed to a Folder called StarsImg, Then i zipped this folder (Name of zipped File is same StarsImg). Now i have uploaded this zip file as Static ...
0
votes
2answers
130 views

Cannot add Static Resource

I am in a developer sandbox within Salesforce, and am trying to follow the "Build the Account Map Display" Trailhead. When I log into the sandbox and access "Static Resources", there is no "New" ...
0
votes
0answers
47 views

Can you reference a static resource from another package

I'm building a base managed packaged as well as an extension managed packaged. I have a static resource in the base packaged (a react resource) and would like to include it on a VisualForce page in ...
0
votes
2answers
531 views

How to use custom fonts in Salesforce Lightning Design system

How i can use custom fonts in Salesforce Lightning Design System. As of now i am using default font provided by SLDS. Is there any way to override default fonts on visualforce page using css/...
0
votes
0answers
110 views

Positioning background static resource image

So I have a static resource which sets an image as a background image CSS: body{ background-image:url("BriefingNotes/Background-pic.jpg") } VF <apex:stylesheet value="{!URLFOR($Resource.zipfile,...
0
votes
1answer
32 views

Static Resource image on a single pdf page

I would like to have my image on the first page of my pdf as a background image and then the following data I have currently such as tables and text. I am not sure how to do this. At the moment my ...
0
votes
1answer
1k views

Adding an image to the email template- viewable in Gmail

I am trying to add an image to the a HTML no header email template. I want to use either static resource or document/files. I refered to this link - https://help.salesforce.com/articleView?id=...
0
votes
0answers
480 views

How to use SLDS CSS as hosted Static Resource in Web-To-Lead

So I am creating a web-to-lead form but I'd like to use the SLDS CSS. I uploaded the SLDS zip to my Org as a public facing static resource. However, when I put it in my HTML page it's not working. (!...