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

Implementing jstree library with Lightning Web Component

This will be a long one, hoping someone can help. Problem Summary: I'm unable to integrate the "Drag and Drop" (dnd) plugin functionality with my LWC that utilises the jstree library (https:/...
  • 151
0 votes
1 answer
17 views

Why is my JavaScript working when it's placed directly in my visualforce page, but not as a static resource?

I have a visualforce page that starts like this: <apex:page controller="FilastController" standardstylesheets="false" showheader="false" docType="html-5.0" ...
  • 17
1 vote
1 answer
25 views

Test.loadData executeBatch Unexpected Exception

I'm writing some test cases for a custom class that interacts with a custom LWC that requires fields from SF contacts. I'm attempting to load test data from a static resource using Test.loadData as ...
0 votes
0 answers
33 views

Use browserconfig.xml with favicon path for StaticResource and VisualForce page

For no Salesforce sites I use: line from index.html <meta content="/assets/favicon/browserconfig.xml" name="msapplication-config"> line from browserconfig.xml <...
  • 61
2 votes
1 answer
137 views

LWC loadScript from static resource with export inside

I have a js library that I created static resource for it: The js library content (the calc.js file for example) like export default calculate = function(x,y){return x+y;} In LWC, I import the static ...
0 votes
1 answer
28 views

Field Integrity Exception occures when importing library in js controller

I'm trying to import pdf.js to my controller. I've created a static resource called "pdf" and attached pdf.js file to it. Then I'm trying to import that with ES6 import keyword but when I ...
-2 votes
1 answer
29 views

What is the best way to gather salesforce data on org limit / static resource usage using REST or SFDX CLI [closed]

I want to keep track of our SF org portfolio/governor limit usage over time and am looking for a way to gather that data in real time. Is there a way to gather info on limit usage such as: Lookups on ...
0 votes
0 answers
40 views

combining salesforce static resource bundles

I have two Salesforce static resource bundles that contain JavaScript files. Is there a way to have Salesforce host both of these from the same URL path? Motivation: I'm looking for a way around the ...
0 votes
0 answers
120 views

Third Party Library DOMPurify on lwc - Failed to execute 'createNodeIterator' on 'Document'

I'm trying to load DOMPurify in lwc in order to sanitize some data, but I cannot find a way to make the library work. I've tried with the minified js file as static resource, with the full files, and ...
  • 53
0 votes
0 answers
31 views

Use fonts store in static resource in external site

I have an external site where for some reason I cannot add there fonts files. I am trying to host the fonts in Salesforce static resource to reference them through public site as described here I ...
  • 473
0 votes
0 answers
40 views

Static resource callout mock with private resource from package

I am using StaticResourceCalloutMock with private resource from package and it gives me 'Static Resource not found' error. I have tried to use package name with namespace and without. But query static ...
  • 25
0 votes
0 answers
27 views

Trouble loading static resource in LWC [duplicate]

I want to use these dialog-samples in my project. I downloaded js and css files, packed into zip and uploaded as static-resource. Trying to use it, I receive ReferenceError: Dialog is not defined. How ...
0 votes
0 answers
38 views

Salesforce static resource image upload via Mule4 not displaying

I have to upload images to static resources via mule 4. The code works fine without any error but the image not displaying in salesforce static resource. I'm getting 200 responses instead of 201. When ...
0 votes
1 answer
2k views

Can we insert an image in lwc cmp without using static resource?

Is it possible to add an image in a lightning Web Component w/o using static resource?
0 votes
1 answer
54 views

Update variable in a JS Static Resource

I have a js library uploaded as a static resource that I am using in my VF page. This library has a "config" object which contains server info etc. The problem is that I need to update the &...
  • 35
0 votes
1 answer
271 views

How to obtain updated static resource referenced by LWC in Communities/Experience page?

After updating a static resource and importing it using import nameOfResource from "@salesforce/resourceUrl/nameOfResource";, only the FIRST version is what is obtained and not any ...
  • 45
-1 votes
1 answer
89 views

Create wrapper LWC for javascript static resource?

I want to use a Javascript library to process some information without reimplementing the entire library in apex is there any way I could embed it in a web component then access it via post method? I ...
0 votes
0 answers
87 views

how to add separate static resource image in angular UI using site?

we using Angular ui using site except in asset folder i am uploaded a separate static resource gif how to call static resource in html <img class="feature-image" [src]="getSFResource(...
2 votes
1 answer
1k views

How do I import and use js static resources in LWC?

I'm trying to use a static resource in a Lightning Web Component. The component is embedded in a Sites (formerly known as Communities) Page, in case that matters The relevant code in the static ...
2 votes
1 answer
310 views

Public static resource not visible

I created a static resource and set the Cache Control to Public. However, when I access the static resource URL directly, I get the Salesforce login page. Here's the URL I'm using: https://someorg--...
4 votes
1 answer
112 views

SFDX: Is there a documentation on list of file extns/mime types that sfdx cli renames the files for?

When we retrieve a static resource and convert into dx format, cli will rename the .resource to .png if mime type in the .resource-meta.xml is image/png. Is there a list of such mime types that cli ...
  • 1,650
0 votes
0 answers
57 views

CSS within Static Resource

I read on other post that when using css within static resource you cannot use classes? I have per example .columnHeader { float: left; width: 50%; padding: 10px; text-...
  • 73
0 votes
1 answer
309 views

Using Aura attribute variable in static resource

I have some aura attributes on my Aura component <aura:attribute name="appName" default="servicePortalVar" type="String"/> I would like to use this variable "...
  • 1,738
0 votes
1 answer
161 views

static resource is not visible

I have a field named Statut__c , it is a picklist ( Active / Inactive ) , i want to get a static ressource named Inactif if the value is Inactive and Actif is the value is Active . i DID get any ...
0 votes
0 answers
66 views

Replacing Static Resource (java script) variables run time

I understand that the static resources (java script) are supposed to be static and loaded only once at run time. However, I have a requirement to dynamically change the content of a script depending ...
  • 1,738
0 votes
2 answers
1k views

Download a CSV file from a lightning component using a button

I'm trying to add a button Download CSV Template where I'll connect the button with a static resource. So, when you click the button, the files downloads, user can open the file, fill and reupload to ...
2 votes
0 answers
115 views

Google Captcha Static Resource to VisualForce Page

I am using google Re captcha in my Visual force Page as below The below one is working as expected. VF Page: <apex:page sidebar="false" showHeader="false" standardController=&...
0 votes
1 answer
1k views

[ResizeObserver is not a constructor]

I am using Pixi.Js and graphology using static resource in lightning aura component. While generation of graph using these libraries I am facing this exception ResizeObserver is not a constructor The ...
-1 votes
1 answer
144 views

How to use google-libphonenumber in LWC?

Requirement is I want to format phone number which is present on Contact record and based on User's locale I want to format the phone number in local as well as international format based on User's ...
0 votes
0 answers
17 views

How can I change the icon color in the rows of the lightning table?

I want to change the color of the iconName of the row in my table, can someone help me? If not, I would like to use a static resource on the text side of my lightning table cell Has anyone experienced ...
0 votes
2 answers
428 views

Custom lightning-icon won't render properly

I'm trying to add a custom lightning-icon to my experience cloud lwc module, but I can't make it render properly. The custom icon is basically a blue background color with a white dash on the middle. ...
0 votes
1 answer
248 views

How to pass an updated parameter to a static resource (React App)?

I am currently using LCC npm module (Lightning Container) to make Apex calls in our React app. However, we are also exploring cutting out LCC altogether (the concern is that it has not been updated in ...
  • 1
0 votes
1 answer
400 views

How to Import lodash into org?

I'm new to lwc and I'm trying to import an external library - lodash. I tried some ways and none of them worked for me. I'm probably doing something wrong I didn't find any good tutorial that shows ...
0 votes
1 answer
330 views

Channel Menu Settings File Not Working

I am trying to set up a channel menu to group our communication channels together for customers. However, our embedded service chat has quite a few customizations I need to carry over, and I am ...
2 votes
1 answer
118 views

Aura Component is referring wrong Static Resource (js method)

I have posted the sample snippet of the problem which I am facing currently. Description I have created two aura components. Each aura component refers different static resources. Both static ...
  • 23
0 votes
1 answer
156 views

Static resource get files from zip

I want to give files from zip in static resource. How can i do it? It gives me 404 on getContent() anyway: with file ending(png,txt, etc) and without. PageReference pageRef = PageReference....
  • 41
1 vote
0 answers
722 views

DataTables taking a long time to load/timing out

Is there anything about the following Datatables code that would cause a timeout or cause issues with the construction of a datatable? First, I have jquery, bootstrap, jqueryui, datables, and moment....
0 votes
1 answer
83 views

Can I get the static resources components name in apex?

I have one requirement where I want the components present in the static resources. I have uploaded the zip files having three images. Now I want to get the names of that three images in apex however, ...
0 votes
1 answer
69 views

Lightning Web Components, How to include a static resource in an unlocked package?

We are wanting to add a static resource file to an unlocked package for a learning project. It is a JS file that we would like to add to the static resources. Can we include that with a package ...
0 votes
0 answers
62 views

Test.loadData is not inserting data for Producer object

I am working on a Data Factory test class and I was able to successfully load relational data for Account, Case, WorkOrder, User, InsurancePolicy and couple of other custom objects by providing Id in ...
  • 391
1 vote
1 answer
177 views

Create subfolder under staticresources

In a Lightning Experience project, I inside force-app/main/default/ there is a staticresources folder. I have both CSS and JS files in there and I'm using them in LWCs using lightning/...
  • 531
0 votes
0 answers
53 views

Query in Batch Apex returns "List has no rows for assignment to SObject" [duplicate]

I have test class where I am using a csv file to insert 200 records Account data. First 100 are like: remaining 100 are like: I am using above created test class to test a batch apex class which has ...
  • 391
2 votes
1 answer
251 views

Import Luxon into LWC

I am trying to use Luxon in a LWC. I believe I am messing up the syntax of the decomposition of DateTime from the library. Following the documentation: https://developer.salesforce.com/docs/component-...
  • 1,889
0 votes
2 answers
353 views

How to import variables into static resouce .js files?

Example There are 3 .js scripts / files as a static resource. First.js Second.js CommonVars.js I am doing something like this in CommonVars.js CommonVars.js var myCommonVars = { NAME : 'STACK', ...
1 vote
1 answer
164 views

Does loadScript from Platform Resource Loader cache results?

I'm exploring writing a LWC mixin that loads a script as part of its use using loadScript from the Platform Resource Loader. The script I want to load is the Apollo GraphQL client Javascript code, and ...
  • 1,218
0 votes
1 answer
184 views

How to ensure that static resources created by me in my sandbox are pulled to my local IDE (IntelliJ)

I tried to pull the static resources using Illuminated cloud as well as through sfdx commands, but can not see the static resources created by me in the static resources folder (in the local IDE)
0 votes
1 answer
761 views

Map returned to JS does not include null values

I use a managed package that gives me the ability to invoke Apex class, get result and handle it. My Static Resource (JS code) invokes Apex to fetch one or more records from the DB and return them ...
0 votes
1 answer
156 views

LWC is not loading after chaning the previous labels in static resource

i have the static resource in the salesforce it has few files related to the d3.jsi changed the label names in the d3v4,js file after that i saved the modified d3v4.js file in the static resource,I ...
-1 votes
1 answer
694 views

Generate Barcode Using JsBarcode library in lightning [closed]

Did anyone have used JsBarcode library in LWC in order to generate code 39 barcode, if yes can you please share a sample how I can use the library and generate the barcode. Till now the steps I have ...
0 votes
1 answer
139 views

Create component used to include other components or static resources

In a custom lightning aura component app, I have a component where I want to include a static resource. I have successfully created the static resource (a JavaScript file) and included it in the ...
  • 531

1
2 3 4 5
9