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
13 views

Can we include custom/static resource image in TreeGrid of Lightning Component [closed]

I have to implement the Account Hierarchy in lightning Component.In that I have to display icon in front of Account name based on type of Account. Icon are custom defined i.e., from static resource
1
vote
1answer
1k 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
1answer
501 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 ...
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. ...
2
votes
1answer
547 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
0answers
22 views

Custom labels in static resource

I am trying to make the data-sitekey into custom label. The datasitekey is in the static resource file. I created a custom label name sitekey. Earlier I was hardcoding the site key and it was working ...
0
votes
1answer
585 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
29 views

Loading Static Resource into Lightning Component

I am trying to access the test.png file from my static resource into my css of a aura component. Working CSS: background:url('/resource/158765027200/test'); //resource path achieved using {!$...
0
votes
2answers
804 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 ...
4
votes
2answers
96 views

LWC: Import JSON from a zip Static Resource

The platformResourceLoader module only offers loadScript and loadStyle. Is there a way to load JSON files from a zip Static Resource?
1
vote
0answers
28 views

Accessing files containing whitespace from a zip Static Resource in Apex

There is a known issue with zip Static Resources that prevents files with whitespace in their names from being extracted (I suppose the Static Resource web service on SFDC cannot handle whitespaces). ...
0
votes
0answers
45 views

Can't import static resource in LWC

I've been trying to access static resource in lwc but I can't use @salesforce because it gives me an error of "scoped imports not allowed when a runtime namespace is specified : lwc". I simply can't ...
0
votes
1answer
430 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
17 views

Firing a js event on afterScriptsLoaded when tab selected

I have a lightning component (inside another component) that loads chartJs resource and I am using afterScriptsLoaded to manage all de graph presentation logic. It works perfectly except for some ...
0
votes
1answer
20 views

How to put a static resource (including loading the same) and related code on a service component and use it on Lightning web component?

I'm trying to understand how can I put javascript static resource and related code on a service component (including loading the resource) and then use it on Lightning web component. Please note ...
2
votes
1answer
43 views

Blob is not a Valid UTF-8 String - Only after “–” [duplicate]

I created a CSV parser that parses CSV's from static resources. I am returned with a Blob is not a Valid UTF-8 String error when parsing the character: "–" different from "-". The "–" is apparently ...
1
vote
0answers
1k 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 ...
17
votes
4answers
21k 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 ...
0
votes
0answers
20 views

Is there any way to make aura component handle a event captured from javascript api in static resource?

Do you know how to make aura component handle an event captured from External javascript api? The process likes below: 1. A javascript api is in the static resource. 2. Aura component contains the ...
0
votes
1answer
534 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, ...
2
votes
1answer
462 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....
0
votes
2answers
384 views

What could be the reason for app.css overriding external styles. How can we prevent it from happening

I have a external CSS stored in static resource. I am referencing style class from that CSS in many places( lightning components and visual force pages). After winter 18 update,few of my styles ...
1
vote
3answers
2k 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 ...
0
votes
1answer
1k 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
1answer
509 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
1answer
305 views

Static JavaScript resource with LWC

LWC rookie here, How can we call a JavaScript function from LWC? For example I have the following static resource helloWorld.js and I'll like to use and call the function in the file. How can I ...
7
votes
3answers
2k 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 ...
2
votes
1answer
265 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 ...
0
votes
0answers
14 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
16 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
38 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
39 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
42 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 > ...
8
votes
4answers
3k 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="...
2
votes
2answers
1k 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 : ...
0
votes
0answers
15 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
37 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("...
3
votes
2answers
5k views

Can I reference a Static Resource in an HTML Area?

I'd like to reference a Javascript file (Static Resource) in an HTML area within Salesforce - is this possible? Or can I only reference Static Resources from a VisualForce page? If it is possible, ...
2
votes
1answer
200 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
1answer
923 views

How to use javascript in static resources and then to refer in VF Page?

This the VF page code : <script> $(document).ready(function() { // SUCCESS AJAX CALL, replace "success: false," by: success : function() { ...
1
vote
0answers
68 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. ...
2
votes
1answer
683 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 ...
0
votes
1answer
49 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
180 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
19 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
628 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
47 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
votes
2answers
61 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
102 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: ...
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 ...

1
2 3 4 5
7