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
0
votes
0answers
11 views

Lightning Icon Static Resource Conditonal

I need to conditonally display icons from a static resource. I am trying to code like this --- <lightning:icon iconName="{!empWrap.emp.Request_Status__c == 'Requested' ? '{$Resource....
1
vote
0answers
15 views

How to test where an imported static asset library fails on import

I have been trying to upload various bundled libraries to static resources to import them into a LWC component. I have been successful in doing this when using api version 39, but this fails on ...
0
votes
1answer
19 views

component lightning static resource js call another js resource

i have a component lightning and i import 2 scripts "PDF.js" and "scripts.js" my static resource have 3 files zip "PDF.js", "script.js" and "worker.js" <aura:component > <ltng:require ...
0
votes
0answers
28 views

Lightning Web component (LWC) Angular App static resource

Running into the issue of invoking Angular App (which is static resource) inside the LWC. What is the right way of invoking static resource application from LWC? Can someone please share an example? ...
0
votes
0answers
19 views

User Creation via Static resource gives error on Profile Id in Sandbox cloned from the other sandbox

I am getting below error when I am trying to run the test class in Sandbox which was clone from one of DEV Sandbox. System.SObjectException: To create or update users for this profile, go to Setup > ...
0
votes
0answers
12 views

Cache Control Not Visible When Creating Static Resources in Both Sandbox and Production Environments of a Professional Trial Org

I noticed that there's no Cache Control settings when I try to create a new static resource in both sandbox and production environment of a newly-created Professional edition trial org. Why is this ...
0
votes
0answers
27 views

Lightning Container NPM - no controller and/or function found

I am working with the lightning-container npm package and have a call in a React app uploaded as a static resource. This simply onClick, calls the LCC.callApex method as below. LCC.callApex("...
2
votes
1answer
78 views

Accessing static resource from ZIP files in Aura component - <ltng:require

I uploaded my zip file which contains css and js folder here is my zip folder structure: static resource name: mystaticresources myuploadzip.zip --js jquery211.js myjs1.js ...
1
vote
0answers
44 views

Partner Communities and Site Prefix

Good day! I recently configured a partner community in a salesforce org and I found out that for resources to be working (either for loading or navigation) a site prefix should be appended in url. ...
0
votes
1answer
33 views

How to retrieve static resource from backup

Apparently a co-worker accidentally overwrote a static resource zip file. I do weekly backups. Is it possible to retrieve past static resources from a zip file?
1
vote
0answers
122 views

Image cannot be displayed because it contains errors

I have a page that contains images stored in static resources. They are inconsistently displaying. I just tried to manually display the image that isn't displaying. I receive the message: The image ...
0
votes
1answer
17 views

How can I carry over my 'dynamic tag' when rendering as pdf from html visual force page?

I have a Lightning Component, that is iframing a VF Page which displays a plain text Static Resource. The VF Page has a text placeholder 'CONTACTNAME' that is replaced with Contact.Name which is sent ...
6
votes
2answers
474 views

Salesforce Community suddenly not accessible

Sometime today my Salesforce Community stopped being available to guest users. For example, a guest user cannot access public static resources. None of the fonts, etc. are accessible. I am in ...
0
votes
1answer
34 views

Sharing a common fragment among multiple Classic email templates [duplicate]

I have tons of classic HTML (with classic letter header) email templates in a classic org. All of the emails share a common HTML disclosure that is text with some hyperlinks. To ensure consistency ...
1
vote
1answer
275 views

JSON files in Static resource lightning web component

I am working with lightning web components and I have static json files. I want to work with them in LWC in my javascript file. its not a zipped file. I want the files to be in static resource because ...
-1
votes
2answers
45 views

How to access the content of 3rd part script with loadscript?

Given the code below, how do I do to have access to ImmutableJS content after the execution of loadscript function? import immutableJsStaticResource from '@salesforce/resourceUrl/immutable_3_8_2'; ...
0
votes
1answer
35 views

ltng:require not able to save syntax error?

I want to load in two static resource js files. My code: <ltng:require scripts="{!join(',' $Resource.resource1, $Resource.resource2)}"/> On save attempt, I get the following error: ...
1
vote
1answer
21 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
25 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 ...
2
votes
1answer
142 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 ...
1
vote
2answers
830 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 ...
2
votes
0answers
288 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
70 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 ...
0
votes
1answer
33 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
21 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
67 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} /&...
2
votes
1answer
327 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
2answers
422 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 ...
2
votes
2answers
713 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 : ...
1
vote
1answer
126 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
1answer
102 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
300 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 ...
1
vote
1answer
54 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
398 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
318 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
32 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
867 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
178 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
24 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
83 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
15 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
37 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
44 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
21 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
358 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 ...
1
vote
0answers
149 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
41 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 ...
4
votes
2answers
1k 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
86 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
33 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 ...

1 2 3 4 5 7