---
schema_version: "1"
id: 04273c38304c71810e873833ea97915aadb155b493176873afbf56434721f232
title: forResource(resourceName)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_System_PageReference_forResource_2.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_System_PageReference_forResource_2.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: af4bc99f317a4316172f76afc0560f8ab7f8732933718085367d078560210955
description: Create a PageReference for a static resource, by name.
---
# forResource(resourceName)

Create a PageReference for a static resource, by name.

## Signature

public static System.PageReference forResource(String resourceName)

## Parameters

- **resourceName**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The resource name

## Return Value

Type: [System.PageReference](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_system_pagereference.htm "A PageReference is a reference to an instantiation of a page. Among other attributes, PageReferences consist of a URL and a set of query parameter names and values.")