---
schema_version: "1"
id: 0629b94c8f5666cf5710bdefcf5536b5976c005d24a68e562863e7df2c387e85
title: URLFOR
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_functions_urlfor.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_functions_urlfor.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 2d47f68579ffe8681416e9b6afd6d36f7442a75e699851fd2983c0db54c457a2
description: Returns a URL for an action, an s-control, a Visualforce page, or a file in a static resource archive. URLFOR is available for use in custom buttons and links, s-controls, and Visualforce pages.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# URLFOR

Returns a URL for an action, an s-control, a Visualforce page, or a file in a static resource archive. URLFOR is available for use in custom buttons and links, s-controls, and Visualforce pages.

## Use

`{!URLFOR(target, [id], [inputs], [no override])}` and replace target with the URL or action, s-control, or static resource merge variable; id with an optional reference to the record; and inputs with any optional parameters. The no override argument is also optional and defaults to `false`. It applies to targets for standard Salesforce pages such as `$Action.Account.New`. Replace no override with `true` when you want to display a standard Salesforce page regardless of whether you have defined an override for it elsewhere.

The input values can be dynamic. For example, to include an account ID, specify:

```
{!URLFOR($Page.myVisualforcePage, null, [accountId=Account.Id])}
```

The resulting URL includes a parameter with the ID, such as:

```
https://MyDomainName--PackageName.vf.force.com/apex/myVisualforcePage?accountId=001B0000002txol
```

You can also use non-string variables, like an SObject variable. For example, if you supply `[myAccountParam=Account]`, the value is converted to a string, and the URL contains `?MyAccountParam=001B0000002txol`. You can also use a parameter to supply a static value, such as `[param1=55]`.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)

Note Because parameter names are static, you can’t use a variable to determine the parameter name. For example, if you use `[myVariable="value"]` and set `myVariable` to `"param1"`, the resulting URL includes `?myVariable=value1` and not the `param1` value.

## Tips

- Use global variables to access special merge fields for actions, s-controls, and static resources.
- If an input parameter name begins with any character other than a letter or dollar sign ($), enclose it in quotation marks.
- Enclose multiple inputs in brackets to indicate they are together:
    
    ```
    {!URLFOR($Action.Case.View, Case.Id, [param1="A", param2="B"])}
    ```
- Set inputs to `null` if you don’t have any inputs to pass, but you want to set the no override argument:
    
    ```
    {!URLFOR($Action.Case.View, Case.Id, null, true)}
    ```
- When you override a standard action, that action is no longer available in Salesforce. For example, if you override the new account action, that affects the New button on all pages, such as the account detail page, account related lists on other detail pages, and the Create New dropdown list in the sidebar. To override a standard action but still access it, use the no override argument in your s-control to reference that action.
- When you override the tab home page for a standard or custom tab, use the tab’s $Action global variable as the target value, and the tab’s object type for the id value. For example, `URLFOR($Action.Account.Tab, $ObjectType.Account)`.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)

Note As of Winter ’25, all Visualforce pages are served on the `force.com` domain or a site domain. `URLFOR` currently returns an absolute URL for all Visualforce pages. See [Ensure Access to Your Visualforce Pages in Summer ’24 and Winter ’25](https://help.salesforce.com/s/articleView?id=001406148&type=1&language=en_US).

![Visualforce Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

Visualforce Example

```markup
<apex:image url="{!URLFOR($Resource.TestZip, 'images/Bluehills.jpg')}" 
    width="50" height="50"/>
```

In this example, the `<apex:image>` component references a .jpg file contained within a .zip file that has been uploaded as a static resource. When uploaded, the name of the static resource was defined as `TestZip`, and the path to the image within the resource is `images/Bluehills.jpg`.