Salesforce Static Resources - Salesforce

What Is Salesforce Static Resources?

The user interface in a Visualforce base can show dynamic content the value of which keeps varying based on user responses. But there are periods when we want some content which must not change with the change in values of other components in the page. For instance, an image file may be essential to persist constant. Such content which cannot be altered in a page is known as a static resource.

Resulting are a few static resources in Salesforce −

  • Images
  • Javascript Files
  • Flash files
  • CSS files

The steps to create a static resource are as below.

Create a Static Resource container

Go to Develop → Static resource and mention the values for name, description and file location for the static resource.

startic_resource_1

Upload a Static Resource

Click Save in the directly above screen to get the file attached to the User Interface controller.

Static_resource

Reference the Static Resource

Next we produce the apex code as in the resulting screenshot to reference the static object we created above.

startic_resource_code

Output

Running the above apex code will make the resulting output. The output shows a static resource.

startic_resource_result

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Salesforce Topics