Can anybody point me to the documentation for this formula please? I was not able to find it in the VF dev guide/help.
-
1URLFOR is under Advanced Functions in this page : developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/… – Vamsi Krishna Gosu Dec 31 '15 at 3:29
-
Another good link (URLFOR Finally Explained): salesforcesource.blogspot.com/2008/12/… – Eric Dec 31 '15 at 6:07
Here it is!
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_functions.htm
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.
-
supplemented by $Action documentation - developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/… – cropredy Jan 7 '16 at 6:28
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.