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
5
votes
1answer
1k 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 ...
4
votes
1answer
1k 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
900 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
1k 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
105 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
207 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
322 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
398 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
97 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
158 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" ...
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 ...
6
votes
1answer
56 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 ...
0
votes
1answer
143 views

Can't access static resources in visualforce page

I have a visulaforce page in which I need to use some static resource. Here is the header of the VF : <head> <meta charset="utf-8"/> <meta http-equiv="X-UA-Compatible" ...
3
votes
1answer
515 views

Access the file which is inside the .zip and inside the folder in which name the spaces are present in lightning

How could I access the image which is inside the .zip and inside the folder in which name the spaces are present in lightning? For example, I have no problems accessing the following static resource: ...
2
votes
0answers
122 views

Include static resource with ltng:require as it is

Let us start with the problem description. I am trying to incorporate d3.js into my Salesforce component. Here is the error I am getting: Uncaught TypeError: Cannot read property 'document' of ...
0
votes
1answer
73 views

How to add folder to a $Resource in lightning

How could I add a folder into $Resource? I know that this is possible for example from over: here : scripts="{!join(',', $Resource.jsLibraries + '/jsLibOne.js', $Resource.jsLibraries + '/...
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 ...
5
votes
1answer
359 views

React app no longer loading with <ltng> component

As SF support for third party frameworks in communities was poor we decided to implement it using the component like so <ltng:require scripts="{!$Resource.react_app + '/www/js/main.js'}" ...
0
votes
0answers
49 views

Can you reference a static resource from another package

I'm building a base managed packaged as well as an extension managed packaged. I have a static resource in the base packaged (a react resource) and would like to include it on a VisualForce page in ...
0
votes
1answer
38 views

What is the best way to define and use a large lookup set

The problem seems so simple, but I was not able to this point to find a solution, even after hours of googling. Problem: We push external data into our Salesforce system and have hundreds of cities ...
0
votes
1answer
98 views

How to access subscriber Org static resource from Managed Package?

We have below line in a VisualForce page. <apex:image id="theImage" value="{!$Resource[customLogo]}" /> CustomLogo is read from Custom settings (Name of the static resource). This works ...
6
votes
1answer
250 views

Can Person Account records be loaded from a Static Resource as test data without a RecordTypeID column?

Question In an org with Person Accounts enabled, it possible to use Test.loadData() to load test Account records from a .csv file as Person Accounts (not as Business Accounts), but without hardcoding ...
3
votes
1answer
197 views

Javascript Static Resource access Custom Permission

we recently decided to refactor coding which uses hardcoded Ids and Names for permission checks on profiles. We want to use custom permissions, which then can be added to permission sets and ...
0
votes
2answers
585 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/...
2
votes
2answers
364 views

How to modify static resources inside folders?

We were able to deploy static resources inside folders from a sandbox, by using IlluminatedCloud as an IDE: we copied/pasted a folder inside staticresources and we placed some files inside it, and it ...
0
votes
1answer
232 views

<apex:slds /> against static resource

I'm using SLDS datepicker on my VF page. I tried <apex:slds /> at the first place to load utility-sprite event icon to click and load the calendar. But it didn't load properly. Then i switched ...
0
votes
0answers
121 views

Positioning background static resource image

So I have a static resource which sets an image as a background image CSS: body{ background-image:url("BriefingNotes/Background-pic.jpg") } VF <apex:stylesheet value="{!URLFOR($Resource.zipfile,...
0
votes
1answer
34 views

Static Resource image on a single pdf page

I would like to have my image on the first page of my pdf as a background image and then the following data I have currently such as tables and text. I am not sure how to do this. At the moment my ...
0
votes
1answer
648 views

How to include the contents of a static resource file in controller class?

I have a controller class with the following method implementation: public String buildTemplate(Task task) { Id taskId = task.Id; List<Task_History__c> listTaskHistory = [SELECT ...
1
vote
1answer
284 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 ...
4
votes
1answer
74 views

Are RecordType Static Resources not Allowed in Apex?

I get the following error when I try to save a test class with List<sObject> recordTypes = Test.loadData(RecordType.sObjectType, 'Record_Types'); "Method does not exist or incorrect signature: ...
1
vote
1answer
76 views

The Looping through a Static Resource List is Not Obeying Conditions

In a test, I load a static resource containing 17 records (rows) for my custom Case Assignment object. A checkbox on this object is named Incorrect__c. Three of the records have Incorrect__c of ...
1
vote
1answer
171 views

Unable to load a CSS static resource even with Developer org

Problem I am currently inside a Developer Sandbox within Salesforce. Inside the developer console I am able to create static resources of the MIME type text/CSS. I know this because they show up ...
1
vote
1answer
123 views

Need help deserializing JSON response

I'm facing some issues with JSON deserializing. I have a JSON format data from my existing webservice and I have collected all that data and made a .txt file and uploaded as a static resource. So my ...
3
votes
1answer
321 views

Lighning Component: Rendering Lifecycle and JS static resources

I would understand the exact order of execution about "Lightning Component Rendering Lifecycle" and JS static resource. For example, we have this First Scenario. Alpha.cmp: <aura:component> ...
0
votes
1answer
157 views

Angular Static Resource Help

I have a feeling this is going to be an impossible ask and will probably get closed but I am truly stumped and hopefully just writing it out will help get the wheels turning. I am trying to work ...
2
votes
1answer
3k views

Refer static resource in custom HTML email template

This seems easy, but I'm unable to refer a static resource in a custom HTML template.The cache-control is set to public. <img src="{!URLFOR{$Resource.Testimage}" height="100"/>
0
votes
0answers
519 views

How to use SLDS CSS as hosted Static Resource in Web-To-Lead

So I am creating a web-to-lead form but I'd like to use the SLDS CSS. I uploaded the SLDS zip to my Org as a public facing static resource. However, when I put it in my HTML page it's not working. (!...
0
votes
2answers
300 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 ...
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 ...
0
votes
1answer
23 views

Package SiteHeader component that references static resource, but allow org package is installed in to change static resource?

I am wondering if I can include a SiteHeader visualforce component with my managed package to be used as the header for force.com sites that references a static resource, but not include that static ...
0
votes
1answer
263 views

Matching string to text in static resource text file

I have a text file in static resources of banned passwords (list contains values such as 'password1234', 'qwertyuiop' etc). When comparing values in list with input pw string, they fail to match. ...
0
votes
2answers
957 views

How to upload a zip file as a Static Resource via Migration Tool

Problem: I am trying to upload a zip file that contains js files, images, etc. as a Static Resource so that I can reference it in a VF page. I am able to successfully deploy the file using the Ant ...
-2
votes
1answer
163 views

Static Resources zip file - Restricting access

Is it possible to restrict access to the static resource zip file which can be accessed using a URL /resource/1502326xxxxxx/images from portal? How should I restrict a portal user from downloading ...
1
vote
0answers
493 views

Static resource in lightning component

My zip file name is APIAI, it contains ApiAi.js. Path for that file is /APIAI/ApiAi.js I have uploaded it as static resource with name as chatbotApi and referring it in lightning component as ...
1
vote
0answers
23 views

Loading resources dynamically with a link or script tag for google chart allowed?

Our App did not pass the App Exchange security review because of the following issue JS not in Static Resource For jquery and datatables there is a officially accepted source file to load data ...
0
votes
1answer
92 views

Using xml file in Static Resources

I am using XML file in Static resources for unit testing. The controller class method validates the contents of XML file.I am passing XMLbody to method as string. When I ran the tests, the coverage is ...
0
votes
1answer
605 views

Trying to use JavaScript file from static resource in VF Page is not working

We have uploaded the following in static resource as a zip file and used it in Visualforce page as follows: Old Tags <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" /> <...
0
votes
1answer
120 views

Email with static resource image from asyncrhony mode

I have process that update checkbox field in object. When this happen it invoke workflow that send email with attachment, and inside the attachment images from static resources. The process which ...
1
vote
0answers
31 views

Different community paths in different environments

I have different URL's in my sandbox and in my production environment. It is causing problems with my static resources in the css files. In my sandbox the community url is https://mydomain.com/...