Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
-2
votes
1answer
506 views

use javascript function in list button onclick javascript

In a List button, i execute javascript code, and for this i defined a static resource where i implemented some functions and i included my resource this way : {!REQUIRESCRIPT('/resource/...
1
vote
0answers
104 views

Mavensmate - Deploy only changes to static resource

I am currently having trouble with deploying static resource using mavensmate. I have a static resource with a lot of images. But the only thing I'm changing is the CSS and every time I deploy the ...
1
vote
1answer
134 views

Static resource naming convention

Is it a good practice to include version information along with the name when you are uploading a static resource. For example, I am uploading a file "Bootstrap-3.3.5.zip" in static resource, Shall I ...
5
votes
1answer
98 views

Does SFDC serve the entire zip static resource, or just the resources referenced?

When I inspect a page in Chrome/Firefox, I don't see the entire zip file as a requested resource. Only the files referenced are served to the client side. Does SFDC unzip resources server-side before ...
0
votes
3answers
2k views

Display HTML from Static Resource in VF Page

I have a HTML file in Static Resource, which I need to display in one of the sections as an overlay in Visualforce page. How can this be achieved? I tried including directly, did not seem to work
3
votes
1answer
238 views

Is it possible to include js files from static resources into listview onclick JS button?

Is it possible to include js files from static resources into listview onclick JS button? REQUIRESCRIPT can't be used anymore for static resources because of this Known Issue that won't be fixed. The ...
1
vote
3answers
557 views

How to replace hardcoded javascript with static resource?

In my page, the javascript coding is as follows <script> function validationcomplete(){ var strg1=document.getElementById("Endereço").value; var strg2=document....
1
vote
1answer
90 views

javascript in static resource

I have written a javascript function whose purpose is to open a case in a primary tab.The idea is to access this function in VF Page through but i'm unable to do it.When i'm opening the page microsoft ...
1
vote
2answers
1k views

How to reference static resource in <style/> block

I have a block that references a background image, that is in my static resources. The example I am going by is : background: url(../img/myimage.png) no-repeat; but i get the following error: ...
4
votes
1answer
2k views

Can A Static Resource Be Accessed From Site?

Pretty simple question. I have a VisualForce Page on which I have the following line: <apex:stylesheet value="{!URLFOR($Resource.MyStyleSheet)}" /> When I access this page via a SiteIt's not ...
1
vote
0answers
34 views

REQUIRESCRIPT and static resources in list onclick javascript button after “Serve Static Resources from force.com domain” critical update [duplicate]

I just want to raise the problem again. The issue with loading static resources using REQUIRESCRIPT in list onclick javascript button can be reproduced again in Summer 15 preview. Anyone else can ...
0
votes
1answer
128 views

CSV as Static Resource, Windows and newline characters not recognized

In our application we use Static Resources to store CSV files that contain record definitions. We have a CSV parser in Apex which usually works fine and correctly reads and upserts records when we ...
1
vote
2answers
1k views

Download pdf and video file from html page

I am stuck at a point where I have to give a link to the user on the UI which on getting clicked will download a pdf and video files. I have placed these files as static resources and I am trying to ...
1
vote
2answers
302 views

Home Page Component - Summer 15 issue

I was using HTML component in home page component for advance search functionality in Narrow (Left) Column of Home Layout. My HTML component was <script language="JavaScript" type="text/...
3
votes
1answer
1k views

Referencing Static Resources URL in AngularJS App

I need to use some icons in static resources in an ng-grid table. I wonder what is the best way to make use of the platform's url resolving. If I put the code src="{!URLFOR($Resource. in Javasript ...
2
votes
1answer
1k views

Visualforce: Can't access archived static resource

I'm trying to access some static resource in my visualforce page. I have uploaded a zip file named pqGrid. It's structure is like so: - pqgrid.min.js - pggrid.min.css - images/ --image1.png --...
2
votes
2answers
569 views

Bootstrap 3 VF javascript not working

I am trying to implement the bootstrap accordion feature: http://getbootstrap.com/javascript/#collapse-example-accordion So I upload the static resource and included in my VF tag But when I render ...
1
vote
2answers
15k views

Disable autoplay on a video played in an iFrame from a static resource

I have an mp4 training video that I am trying to add to my Account page layout via an inline Visualforce page. The video is stored as a static resource (Create_New_Contact). I have successfully ...
2
votes
2answers
198 views

Loading HTTP resource in Visualforce pages

Is there a way to allow loading of non secure resources from external sites in Visualforce pages? Below is the scenario I have. I am creating a force.com site page. The template I received for the ...
0
votes
1answer
630 views

Creating static resource in salesforce through java code

I am trying to create static resource in salesforce through java code. I am fetching the content of a file which is stored in my system and encoding it into base64 format and putting that content into ...
1
vote
1answer
602 views

URLFOR($Action… returns URL No Longer Exists from $Resource; works fine outside

Thanks to Marty C., I am able to create links in VF (with the JS defined in the page) that work in the Service Console (okay - still working on mailto:), and I want to move them to a Static Resource. ...
7
votes
2answers
2k views

Using static resources in OnClick Javascript buttons after “Serve Static Resources from force.com domain” critical update

We're using list view and details OnClick Javascript buttons which reference custom js ans css files stored in static resources and containing some shared logic/styles. The sample code below ...
3
votes
1answer
132 views

Add a Javascript to my Home Page Components

I'm really new with Salesforce but I'm trying to add a Javascript to my Home Page components and I develop the Javascript which inject some values in the address (like Post code according with what ...
2
votes
1answer
746 views

Add the attachment with image from static resource and value from text area field as pdf file

I generating the attachment from trigger action, Need to generate the attachment as pdf file, contains image from static resource and value from text area field. I have trying to use blob.toPdf() to ...
1
vote
0answers
215 views

Lightning - static resource deployment - javascript code

I am using the migration tool to deploy javascript files containing logic to display charts in a lightning component. To test my code I need to set the chrome developer console to not cache files to ...
0
votes
1answer
75 views

Force.com IDE takes forever to save JSON static resource

In my package I have a JSON file served as Static Resource. Whenever I change and save this file from a current version of the Force.com IDE it takes forever until its finally saved. I idles around 23%...
0
votes
1answer
444 views

Referencing the custom component in the static resource

I'm uploading a component and the controller class to the static resources and trying to use it in a vfp. But when I save the vfp with the reference, it throws an error that the component does not ...
0
votes
1answer
473 views

editing Static Resources in SalesForce

How can I edit Static Resources in SalesForce? While using css I need to edit and check it many times.
5
votes
2answers
2k views

document.getElementById('id').innerHtml = Static Resource Image

I have written one JS function on click of radio button, I want to show my Static Resource - Image file Help me out here **document.getElementById('id').innerHtml = ****************** My Static ...
0
votes
1answer
65 views

JS code on Button

Hello Guys i have a little tricky question regarding static resources. I have made a js code and now i want to use this js code on the click event of a button ?My question is that can we right this ...
1
vote
1answer
22 views

Querying particular static resource from complete pages in Org

I need to check for a particular resource in different VF pages.Normal method will be opening each page and checking for the static resource(Image/JS files) but is there any other probable method ?? ...
0
votes
2answers
706 views

Error with HTML tag for image static resource

I am getting an HTML tag output instead of the Image in a formula field. The image is stored as Static resource in salesforce. Can someone let me know the possible reason for the error and a way out ...
5
votes
1answer
6k views

Accessing Non-Static Variables in Static Methods of a Visualforce Controller

I have a scenario where I have one Vf page called 'myVisualforce' and a custom controller 'myController'. In myController I have some non-static variables for example 'var1' and 'var2' and I have few ...
0
votes
1answer
82 views

Control formula field display based on User

I have a requirement to display an Alert image that I have uploaded as a static resource to the User who is viewing the record only if the User is owner of the record. Can someone please guide me ...
3
votes
0answers
415 views

Is it possible to include a Mustache.js Template saved to a Static Resource within a VisualForce Page?

My VisualForce page includes the following Mustache.js template code: <script id="template" type="x-tmpl-mustache"> <tr><td>{{LastName}}</td><td>{{FirstName}}</td&...
5
votes
2answers
2k views

Is it possible to use Remote Object jsNamespace with an apex:includeScript?

Currently playing with An Example of Using Remote Method Overrides in Remote Objects My VisualForce Page includes the following <apex:remoteObjects jsNamespace="$RemoteContactModel"> <...
2
votes
2answers
699 views

Font file in zip static resource Cross-Origin Request Blocked

I have a zip file of fonts. These fonts are referenced in a VF page that renders as text/css. (src:url({!URLFOR($Resource.ZipFile, 'fonts/OpenSans-Bold.ttf')});) The URL resolved to the correct font ...
3
votes
1answer
3k views

Font files in Static Resources resolve to 404

I have a CSS file in the Static Resources and in that I have styles for specific fonts. These fonts are also in the Static Resources. If I paste the URL for the font files (ie. font.ttf) into the ...
0
votes
1answer
323 views

Why isn't this dynamic VisualForce page style toggling the Static Resources properly?

I'm currently looking at the Dynamic References to Static Resources Using Mostly, it works as expected, with one anomaly: When the page initially displays, as expected, it correctly uses both the ...
3
votes
2answers
2k views

Invoking Javascript on VF Page from Static Resource

we have a Javascript sheet saved as a static resource and one of our developers is attempting to invoke a function from it in our visualforce page. In our visualforce page, we are using: <apex:...
1
vote
1answer
291 views

Reference Static Resources or Documents with direct link and no login to system

Is there a way to access static resources or documents without being logged into the system. So if the file in not marked as "Internal Use Only", can I provide a direct link to it for others to access ...
1
vote
1answer
1k views

static resource cache old image

I have css file in static resources which refer to Images folder(.zip) to apply images to css classes. The gotcha is when i replace some images from images folder, on page it still showing older image....
1
vote
2answers
696 views

Refering Static zipped Resource in a Visualforce

I'm trying to reference a zipped icon in a VF like this: <img src="{!URLFOR($Resource.icons,'clock.png')}" class="orgIcon" /> Where icons is the name that I give the static resource. I've ...
1
vote
1answer
1k views

Inserting Test.loadData in into Salesforce DB for tests

I am able to load the static resource but I am unable to insert the loaded accounts into salesforce. I want to do this to be able to test various methods that depend on first selecting a particular ...
0
votes
1answer
1k views

How to Use an XML Static Resource to Program Unit Tests?

I've created a static resource XML file and uploaded it to my test org. My code coverage is around 41% and needs improvement due to there being numerous nodes in the XML file that need to be loaded ...
1
vote
2answers
552 views

Unit Testing Involved Multiple Objects

I used a static resource to perform a unit test on the loading of a sample contact. Previously, code coverage was at 0% and improved to 1% after running the test. My code is as follows: public ...
8
votes
1answer
311 views

PDF using Static Resource generated from REST doesn't display My Image

I have different ways in my organization to generate my invoice pdf and attach it to my records. My PDF includes a logo stored in a public StaticResource. It works perfectly everywhere except when I ...
6
votes
2answers
332 views

Javascript Button Issue

Full .js button code: {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} {!REQUIRESCRIPT('/resource/' & LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(NOW()),':',''),'-',''),' ',''),10) & '000/JS')...
5
votes
1answer
3k views

How to reference static resources from a Community HTML header in a cache-compatible way?

Communities allow you to specify an HTML document as a header. However, it's just static HTML – no VisualForce. Therefore, you can't use URLFOR() to generate cache busting URLs to static resources, ...
2
votes
1answer
1k views

Accessing Local Static Resources from a Managed Package

I keep seeing conflicting information about whether this is possible, so hoping the supreme court of StackEx can definitively rule! I have a managed package that queries a field on the campaign ...