博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[salesforce] URLFOR function finally
阅读量:4911 次
发布时间:2019-06-11

本文共 2318 字,大约阅读时间需要 7 分钟。

While developing your Visualforce pages you may need to be able to obtain the URL of certain actions, s-controls or your static resources.

I found it personally a challenge since the documentation for "URLFOR" function is not included in "Visualforce Developer Guide" itself and instead included in the general help area of Salesforce.
Generally you can use the "URLFOR" function for three purposes:

  1. Obtain URL of a s-control
  2. Obtain URL of a static resource
  3. Obtain URL of an object's action

In this article I will demonstrate usages of the three above.

Generally, URLFOR function returns a relative URL for an action, s-control, or a file in a static resource archive in a Visualforce page. Following the syntax of the function:
{!URLFOR(targetid, [inputs], [no override])}
Parameters shown in brackets ([]) are optional.

  • target: You can replace target with a URL or action, s-control or static resource.
  • id: This is id of the object or resource name (string type) in support of the provided target.
  • inputs: Any additional URL parameters you need to pass you can use this parameter.
    you will to put the URL parameters in brackets and separate them with commas
    ex: [param1="value1", param2="value2"]
  • no override: A Boolean value which defaults to false, it applies to targets for standard Salesforce pages. 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.

Obtaining URL of a s-control:

Link to my S-Control

Obtaining URL of a Static Resource

Obtaining URLs of an Object's Actions:
In order to get URL of the an object's actions you need to know what actions that object supports. Below are some of the common actions most Objects support:

  • View: Shows the detail page of an object
  • Edit: Shows the object in Edit mode
  • Delete: URL for deleting an object
  • New: URL to create a new record of an object
  • Tab: URL to the home page of an object

However, each object may support additional actions for example Contactalso supports "Clone" action and Case supports "CloseCase" action.

New
View
Edit
Delete
Home

转载于:https://www.cnblogs.com/yqskj/p/3414807.html

你可能感兴趣的文章
[转]第一章 Windows Shell是什么 【来源:http://blog.csdn.net/wangqiulin123456/article/details/7987862】...
查看>>
iOS获取设备UUID和IDFA
查看>>
模糊查询
查看>>
linux 出现:-bash-3.2$提示符
查看>>
jsp电子商务 购物车实现之二 登录和分页篇
查看>>
科普:搜索引擎的基本工作原理
查看>>
Docker Compose 原理
查看>>
mongodb index 的background 及集群的索引建立
查看>>
判断两个控件在同一个Window上是否有重叠
查看>>
Android+Jquery Mobile学习系列(3)-创建Android项目
查看>>
android:inputType参数类型说明
查看>>
android 抽屉式滑动demo
查看>>
Swift语言Storyboard教程:第一部分
查看>>
unload事件Ajax提交问题
查看>>
代码工程flex不显示GIF图片问题
查看>>
Kotlin 初窥门径[2]:流程控制
查看>>
Android利用Socket与硬件通信之智能家居APP
查看>>
Idea中提交SVN或git时,忽略某些文件不提交
查看>>
20135236、20135206第一次试验报告
查看>>
Java的“Goto”与标签
查看>>