Can anybody point me to the documentation for this formula please? I was not able to find it in the VF dev guide/help.


Here it is!


Returns a relative URL for an action, s-control, Visualforce page, or a file in a static resource archive in a Visualforce page.

This can be used to return a reference to a file contained in a static resource archive (such as a .zip or .jar file). {!URLFOR(resource, path)} Replace resource with the name of the static resource archive expressed as a merge variable (for example, $Resource.resourceName), andpath with the local path to the file in the archive that you want to reference.


This is well-covered in the Visualforce in Practice documentation, an often overlooked VF resource.

See section "Stateless Actions" in Chapter 2 for a good explanation with many examples. The documentation takes the mystery out of the $Action.xx global variables and tells you what to use for the second URLFOR argument when the id is null. You'll also see how to encode the parameters which frequently trips up VF developers.

I know I found URLFOR confusing when I started with SFDC so take a look at this doc. You'll find other gems as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.