Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
0answers
21 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/...
2
votes
2answers
86 views

lightning:icon pointing to SVG static resource has empty shadow root

An working SVG icon stored in a public static resource myicon_svg <?xml version="1.0"?><svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><g id="...
3
votes
1answer
103 views

LWC1513: @salesforce/resourceUrl modules only support default imports

I am trying to import a 3rd party javascript library into my LWC and everytime I try to push the code to my Scratch Org, I get the below error. LWC1513: @salesforce/resourceUrl modules only support ...
1
vote
1answer
30 views

Is it possible to instantiate a javascript static resource?

I have a static resource to reuse javascript between my lightning components. I'd like the code to use specific credentials for an api in a sandbox, and another in production. I plan to use an apex ...
11
votes
1answer
715 views

Is the 5 MB static resource size limit 5,242,880 bytes or 5,000,000 bytes?

Documentation such as Static Resources says: A single static resource can be up to 5 MB in size. An organization can have up to 250 MB of static resources. We have one growing static resource of ...
0
votes
0answers
42 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
11 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
20 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
0answers
10 views

How to use static resource image in Lightning component CSS file [duplicate]

I am trying to use a static resource in a lightning component .css file: .THIS .website-header { height: 209px; background-image: url('{!$Resource.website_header}'); } But it renders without ...
0
votes
1answer
26 views

How to query the Static Resources and Visualforce page repository in a sandbox from a client application?

I'm new to Salesforce, from the target.lightning.force.com domain I want all of the Visualforce pages and Static Resources for a given user to be copied to my local filesystem. Unless there's a way ...
2
votes
0answers
23 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 ...
0
votes
0answers
83 views

Content sniff protection and JS file in Zipped Static resource - Safari

I have a static resource with some JS files in it. One of them is jQuery 3.1.1 When attempting to load a VF page I am getting the following error from SF and it refuses to load. The workaround HERE ...
0
votes
0answers
18 views

Can Static-Resource Files be Listed via Apex? [duplicate]

Is there a way to programmatically list the files in an archive static resource (i.e. .zip)? I know it's been asked whether a static resource can be accessed via Apex, but only to then specify a ...
0
votes
1answer
130 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
19 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}" ...
0
votes
0answers
23 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 ...
2
votes
1answer
240 views

D3 JS Library not working with Web Components

I am attempting to follow this documentation to create a very simple bar graph, however, it seems as though Salesforce has no idea what is in my D3 static resource as it says ____ is not a function ...
0
votes
0answers
61 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
2answers
22 views

Trying to use static resource in visualforce page controller test class

I have a visualforce page controller class which has a soql in the beginning select <fields> from <custom_object_A> where appnum = <fetched_from_vf_page_parameter>; The controller ...
0
votes
1answer
327 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 ...
1
vote
0answers
239 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 ...
0
votes
2answers
294 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 ...
1
vote
1answer
28 views

Loading image in static resource within css

I'm new at VF develop. please help. I loaded many image in VF like below, and it works well. <apex:image alt="s01" title="s01" url="{!URLFOR($Resource.resource_images, '/s01.PNG')}"/> However,...
0
votes
2answers
49 views

How to use Labels in static resource

I am using static resource, file default.js, where all javascript magic for visualforce page happens. But, I come to the problem, when i want to use custom labels, there is an error $Label is not ...
1
vote
2answers
175 views

Access window object outsite of locker in component (Running Angular in Lightning Components)

I am trying to add an object to the window, but I need it to be outside of the secure DOM. Is this possible? I have functions such as runtime below that are evaluating within the secure window. I ...
0
votes
2answers
195 views

Detecting UI Theme from Javascript Static Resource

is there a way to detect if I stay in Salesforce Classic or Salesforce Lightning context from javascript as static resource? I need this because before to detect the user theme I used if(sforce &...
1
vote
0answers
168 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 ...
0
votes
1answer
85 views

how to reference a static resource in my local DX project

I'm trying to reference a .csv that is in my project as a static resource. I'm trying to use the .csv in a test data factory class. Coming from Javascript I'm used to importing files at the top of ...
1
vote
1answer
377 views

Error including static resource

I am working on a lightning component in my Salesforce Community. Yesterday it worked fine and out of the blue, I started getting the following error in the community builder. I am including the ...
0
votes
2answers
88 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 ...
4
votes
1answer
233 views

Hard-coded resource path vs $Resource global variable?

I've never been able to work out which format is better or if there any differences between these lightning resource access formats: <img src="{!$Resource.your_pic}"/> And <img src="/...
0
votes
1answer
286 views

How can I refresh the cache for static resources in Communities?

I have updated a static resource with a new file and kept the reference (using url not $Resource) the same. The updated resource was not loaded, even when I left it over the weekend. Even deleting the ...
1
vote
3answers
147 views

How can I move my spinner into a separate Lightning Component?

I have a lightning component which includes a spinner rendered by this code: <aura:component access="global" controller="SomeAuraController" implements="flexipage:availableForRecordHome,...
0
votes
2answers
271 views

play audio file in lightning component

I have added an mp3 file as a static resource, can someone please help me to call that resource in the lightning component so when I hit the button it will play that static resource as per the ...
3
votes
1answer
622 views

How can I access the html text in static resource file in lightning client-side controller?

How can I access the html text in static resource file in lightning client-side controller? I know how to upload .html file to static resources and how to acquire it using <ltng:require>, but I ...
1
vote
1answer
226 views

Display static resource image from formula field on visualforce page.

Ok, I have a formula field that references a static resource image. This formula field displays correctly within the standard Salesforce UI but when I try and add the field to a custom visualforce ...
5
votes
1answer
824 views

What is recommended way to unit test JSON Parser based on JSON.deserializeUntyped calls?

We are doing a lot of JSON data parsing in our solution by own JSON parser implementation. I wonder how can I write unit tests for JSON parser. Is it good approach to load JSON data from static ...
0
votes
0answers
12 views

Is it possible to use URLFOR in HTML template for e-mails? [duplicate]

I have an HTML template for e-mails and would like to add an image(logo) in the template in way to display the logo in every change of the environment - sandbox to production. Is there way to use ...
4
votes
1answer
735 views

Static Resources not found by Customer Community Lightning Component

Static resources aren't loading when my Lightning Component is hosted on a Customer Community page. They do load in-app, so I'm guessing there's a namespace issue with my resource paths when I use the ...
3
votes
1answer
598 views

CSS/Javascript static resources not loading

I've loaded css/js static resources to Salesforce in a fivestar.zip file. This resource also contains an svg. fivestar.zip --rating.css --rating.js --stars.svg When attempting to load these ...
2
votes
1answer
923 views

ltng require scripts not working for me!

I'm having trouble accessing my static resource (a js lib) in my controller.js in my lightning component. My goal is to bundle up all my javascript functions and classes and use across most ...
1
vote
1answer
81 views

Avoid caching for the static resource [closed]

Let's say we don't want to use visual force page at this case. I want to show the static resource in a external site. Let's say filename: me.png however, user will keep updating this file. Then, ...
0
votes
1answer
115 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 ...
2
votes
1answer
247 views

Dynamically created ltng:require component results in 503

If I try and create a ltng:require component for a script dynamically, I get a 503 server error: component.cmp <aura:component implements="forceCommunity:availableForAllPageTypes" access="global" ...
0
votes
1answer
294 views

Error with jsPDF static resource in lightning component

I am trying to download in PDF format in lightning component. I have added jsDPF zip file in static resource. Static rescource name:jsPDF, zipFile name:jsPDF,Folder name:jsPDF-1.3.2 On previewing ...
-1
votes
1answer
62 views

How can i install manage package into professional edition account

I am unable to install manage package into professional edition account and got error I need steps and guide lines to install package. Thanks
0
votes
2answers
118 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
98 views

Evaluate the static resource url stored in a field of the record of the custom metadata type

Is it possible to evaluate the static resource url stored in a field of the record of the custom metadata type? For example I have the following record: After querying the value of the field Static ...
3
votes
1answer
155 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 ...
6
votes
1answer
51 views

Libraries inclusion propagation to children components in Lightning

If I have a parent lightning component and the component has ltng:require do I need to require the same libraries from the children components or will the inclusion be propagated to children? For ...