The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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.

Filter by
Sorted by
Tagged with
1
vote
1answer
13 views

Referencing a static resource from within a static resource

I've got a static resource with some javascript I've written which requires another static resource to work. I would like to include the reference to the required static resource within my static ...
0
votes
1answer
15 views

Image formula field render issue

I have a formula that is rendering a static resource based on checkboxes on my Contact record. The issue I am seeing is that when the image loads, it appears super tiny - the static resource is not ...
6
votes
3answers
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="...
1
vote
0answers
42 views

Unable to upload the LDS 2.10.0 as static resource

As we know that static resource has a limit of 5MB, I am trying to upload the LDS winter 20 as static resource, but its size is more than 5 MB https://lightningdesignsystem.com/downloads/ In this ...
2
votes
1answer
136 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....
1
vote
2answers
108 views

How can I dynamically load a static resource image in LWC?

I am trying to dynamically load an image from a static resource within LWC. When the user loads the page, a query parameter is provided called locationCode. Depending on the locationCode, a different ...
1
vote
1answer
875 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 ...
3
votes
2answers
3k 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. ...
1
vote
1answer
41 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
0answers
70 views

Load third party JS in LWC

I created a static resource with just one JS file. However when component rendered it gives me an error "undefined". Template: <!-- videoPlayer.html --> <template> <div class="...
0
votes
3answers
65 views

Create sObject dynamically

I ve tried this script to create accounts from excel file and it works,but if this file had more fields ,I would have to store their values one by one.Is there a way to do this mapping using something ...
8
votes
2answers
17k views

how do we access the image files from static resource in css?

I am trying to display images from a static resource in a css property. .PDF { width:50px; height:50px; background-image: url("{!URLFOR($Resource.FileTypes, 'png/pdf.png')}"; } What i ...
0
votes
1answer
28 views

Dynamic static resource in custom visualforce email template

Background I am trying to add a dynamic link in a visualforce email template to download a PDF which is stored as a publicly available Static Resource: <a href="https://x.cs.force.com/site/{!...
0
votes
1answer
18 views

Including static resource javascript file in another static resource

I have many visualforce pages which are pulling in the same static resource js files. How do I include one static resource within another static resource so I only have to pull one file into the ...
0
votes
1answer
27 views

Error: variable mygif has been optimized out

I want to use a gif static resource as a loading image in a LWC. I import it in the JS file: import mygif from '@salesforce/resourceUrl/mygif'; and use it in the HTML file: <img src={mygif} /&...
0
votes
2answers
469 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 ...
3
votes
1answer
628 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 ...
2
votes
2answers
113 views

LWC Static Resource Fonts [closed]

I am trying to load fonts from a static resource into my LWC component. I have tried using loadStyle and loadScript from platformResourceLoader but neither work. Are there any other methods that may ...
0
votes
1answer
440 views

How to call static resource image in another static resource css file?

How to call static resource image in another static resource css file?.i save one image in static resource as a name flowerimage.then that flower image calling from css as a url($Resource.flowerimage, ...
1
vote
2answers
230 views

Unable to load 3rd party lib in Lightning Web Component

I'm trying to import a 3rd party javascript library from static resources in my lightning web component. I followed the exemple given in LWC documentation. I encounter the folowing error : ...
3
votes
2answers
3k views

Create static resource with apex code

Is there a way to create a StaticResource within a Apex code. this the code i am doing: StaticResource sr = new StaticResource(); sr.Body = file; sr.Name = 'testLicence'; ...
1
vote
1answer
55 views

Use Zipped Static Resource for “Display Image” component in Lightning Flow?

In Lightning Flow, can I use Zipped Static Resource for "Display Image" component? I'm building a Flow in the Lightning Flow Builder and I want to add images to the Flow. I already have a zipped ...
0
votes
2answers
586 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
1answer
47 views

Odd static resource behavior between aura component and LWC in the same aura app

This behavior seems odd to me... So, a static resource loaded into a VF page creates a variable 'someVar' that can now be used on the VF page. A lightning component and a lightning web component ...
0
votes
1answer
152 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
1answer
636 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 ...
2
votes
2answers
228 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
209 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
794 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
107 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"> {!...
7
votes
2answers
1k views

Accessing Static Resource Contents from Lightning JS Controller

I am attempting to set the value of a lightning component attribute with the type JSON to the contents of a JSON static resource file. I am using the following to set the attribute from the client ...
0
votes
1answer
344 views

Javascript Static Resource Cannot Be Found

I added a javascript static resource to a folder called VisualForceElements like so: Then within my opening <apex:page> I make the call to reference the resource like so: <apex:...
0
votes
1answer
16 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
40 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
11 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 ...
2
votes
1answer
1k views

Unable to access static resources for some profiles

Unable to access static resources for some profiles who doesn't have view and setup configuration. I have a xml file in my static resources we query that static resources and do the processing with ...
14
votes
4answers
16k views

accessing static resource in apex

I know that we can access static resources in visualforce page as follows; {!URLFOR($Resource.UploadTemplate)} How can we access the static resource in APEX class? And if it is in a zip file, how ...
3
votes
1answer
194 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 ...
0
votes
1answer
33 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
39 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
1answer
399 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 ...
0
votes
0answers
19 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
254 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 ...
2
votes
0answers
574 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 ...
1
vote
0answers
73 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
32 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
79 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 ...
1
vote
2answers
361 views

Special characters in static resource

The nordic characters æøå are displayed as question marks in JS static resource after reopening the file in the Developer Console. An alert box with these characters will also display as question ...
0
votes
2answers
25 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 ...