Creating static resources in Salesforce is important when you need to store reusable files like images, text files, or HTML content for document generation. It helps maintain consistency across templates and ensures assets are centrally managed. In this guide, we will go through the steps to create and use static resources to support Salesforce document generation effectively.
Step 1: Login to Salesforce.
Step 2: In the Quick Find box, type Static Resources. Then click Static Resources under Custom Code.

Step 3: On the Static Resources page, click the New button.

Step 4: Enter Static Resource Details.
Name: Enter Name (e.g., Staticcontent).

Step 5: File: click Choose File and upload your file (e.g.txt., Image).

Step 6: Click save.

Step 7: The static resource has been saved successfully.

Step 8: Copy the Name (for example: Staticcontent).

Step 9: Add Static Resource Merge Syntax on template.
- Â For Text – {{StaticResource.Staticcontent}}.
- Â For Image – {{Image:StaticResource..Staticcontent}}.
- Â For HTML content – {{HTML:StaticResource.Staticcontent}}.

Step 10: Go back to the object record → Generate document to view the output.
- Text file Output


Conclusion
Using static resources allows you to manage reusable content efficiently within Salesforce and include it seamlessly in document generation templates. This approach keeps your files organized, consistent, and easy to maintain. By following these steps, you can enhance Salesforce document generation process with structured static assets while ensuring better control over template design and output quality.
Frequently Asked Questions
Related Blogs
How to Generate Letters in Salesforce
Creating professional letters directly within Salesforce can often become time-consuming when handled manually. Businesses today need a faster and more…
How to Set Up the QVar Parameter for Dynamic Document Templates in Salesforce
If you want your document generation process to dynamically display templates based on specific record data, setting up the QVar…
How to Create an Agreement in Salesforce
Creating agreements manually in Salesforce can quickly become time-consuming, especially when you’re copying Account details, billing addresses, or related Opportunities…