在Salesforce中可以向Object所对应的Layout中添加我们自定义的Visualforce Page。 此时的Visualforce Page与Asp.Net MVC中的Partial View有着异曲同工的妙处。

那么如何完成整个流程呢?请看如下操作步骤:

 1):在自定义的Visualforce Page中要添加如下标签

  【standardController标志此Page可以添加到哪个Object所对应的Layout中】

  【extensions指定了对应的后台Class文件】

  1. <apex:page standardController="Account" extensions="CreditLimitController">

2):处理后台的Class文件,完成我们所需要的特定逻辑

  【ApexPages.StandardController与Page中指定的standardController向对应】

  【(Account)controller.getRecord()获取了当前操作的Object,这里指向的是Account,实质上获取的是该对象的id,若要获取其他更加详细的信息,需要根据id进行query】

  1. public class CreditLimitController {
  2. //added an instance varaible for the standard controller
  3. private ApexPages.StandardController controller {get; set;}
  4. // the actual account
  5. private Account a;
  6.  
  7. public CreditLimitController(ApexPages.StandardController controller) {
  8.  
  9. //initialize the stanrdard controller
  10. this.controller = controller;
  11. this.a = (Account)controller.getRecord();
  12.  
  13. system.debug('---------002Account Id ' + this.a.Id);
  14. }
  15. }

3):上2个步骤已经将自定义的Visualforce Page准备完毕,接下来我们进入Account所对应的Page Layout中,如下图所示

4):点击上图的Edit按钮,在Fields中找到Section,手动拖拽一个Section到指定的位置

5):在Visualforce Pages中我们可以看到我们刚刚创建的Page(CreditLimit),然后用拖拽的方式将此Page添加到刚刚添加的Section中

这样我们就完成了将自定义的Visualforce Page添加到指定的Page Layout中。

更多详细的内容,请看如下链接:

http://blog.jeffdouglas.com/2009/05/08/inline-visualforce-pages-with-standard-page-layouts/

http://blogs.developerforce.com/systems-integrator/2008/11/adding-a-visualforce-page-to-a-page-layout.html

http://help.salesforce.com/apex/HTViewSolution?id=000004503&language=en_US

在Salesforce中向Page Layout中添加Visualforce Page的更多相关文章

  1. Android中查找一个Layout中指定的子控件

    我们通常希望查找一个页面中指定类型的控件,单个控件知道id很容易找到,但是如果是多个呢?或者说是在程序中自定义的控件,且不知道id怎么办呢?如想找到页面中的Spinner,可用以下方法 /** * 从 ...

  2. salesforce零基础学习(九十四)classic下pagelayout引入的vf page弹出内容更新此page layout

    我们在classic环境中,有时针对page layout不能实现的地方,可以引入 一个vf page去增强标准的 page layout 功能,有时可能要求这个 vf page的部分修改需要更新此 ...

  3. 转载 SharePoint 2013配置Master Page and Page Layout

    转载原地址: http://www.cnblogs.com/huangjianwu/p/4539706.html 涉及到的内容是关于SharePoint 2013如何部署自定义的母版页和布局页. 进入 ...

  4. Page Layout里的javascript (jquery)不执行

    在page layout 中通过 _spBodyOnLoadFunctionNames.push("js 方法名") 的方式实现. 但切记,代码要放到 PlaceHolderMai ...

  5. Salesforce随笔: 将Visualforce Page渲染为PDF文件(Render a Visualforce Page as a PDF File)

    参照 : Visualforce Developer Guide 第60页 <Render a Visualforce Page as a PDF File> 你可以用PDF渲染服务生成一 ...

  6. SharePoint 2013 Deploy Master Page And Page Layout

    2013年9月27日的一篇随笔,其实也是自己编写的部署文档,由于客户是HK的,所以描述部分是用英文. 涉及到的内容是关于SharePoint 2013如何部署自定义的母版页和布局页. First, L ...

  7. Creating a Custom Page Layout in SharePoint 2013

    Creating a Custom Page Layout in SharePoint 2013 In my last article, I documented how to create a Ma ...

  8. 【转】iOS6中的Auto Layout:通过代码添加约束

        最近做的项目用到了Auto Layout,于是经过了一番大量的google,这是我看到的讲用代码创建约束最清晰的一篇教程,于是想跟更多的人分享一下.原文也比较简单,可以直接过去看,如果我翻译的 ...

  9. 往Layout中动态添加View

    需要注意几个方法:基本上所有的方法参数单位是px 1.设置View的宽高: LinearLayout.LayoutParams params = new LinearLayout().LayoutPa ...

随机推荐

  1. python to be Windows Daemon

    参考:http://assback.iteye.com/blog/1731565 安装 pywin32-.win32-py2..exe #32bit pywin32-.win-amd64-py2..e ...

  2. The Imitation Game

    <The Imitation Game>是一部非常好的电影,讲述了人工智能之父——阿兰图灵的传奇一生. 重点讲述了他通过破译德国的通讯密码缩短了二战的持续时间,因而拯救了无数生命的伟大事迹 ...

  3. [Linux]安装phpredis扩展

    1.下载phpredis,解压并进入目录,在目录下运行phpize /usr/local/php/bin/phpize ./configure --enable-redis-igbinary --wi ...

  4. BestCoder22 1002.NPY and arithmetic progression(hdu 5143) 解题报告

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5143 题目意思:给出 1, 2, 3, 4 的数量,分别为a1, a2, a3, a4,问是否在每个数 ...

  5. mysql中Access denied for user 'root'@'localhost' (using password:YES)

    关于昨天下午说的MySQL服务无法启动的问题,解决之后没有进入数据库,就直接关闭了电脑. 今早打开电脑,开始-运行 输入“mysql -uroot -pmyadmin”后出现以下错误: “Access ...

  6. 【leetcode】Implement strStr() (easy)

    Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle ...

  7. 【python】下载远程内容到本地

    来源:http://www.jb51.net/article/42630.htm urllib模块 urlretrieve方法 urllib.urlretrieve(url[, filename[, ...

  8. 关于Javascript splice方法的一个坑。

    w3c相关文档:http://www.w3school.com.cn/jsref/jsref_splice.asp bug:购物车计算价格的时候.加商品没问题,减商品的时候价格总是计算错误. 经排查发 ...

  9. C# 泛型约束

    一.泛型简介1.1泛型通过使用泛型,可以创建这样的类.接口和方法,它们以一种类型安全的工作方式操作各种数据.本质上,术语“泛型”指的是“参数化类型”(parameterized types).参数化类 ...

  10. Swift - 代码创建单例

    创建单例的方法 import UIKit //创建一个单例类 class SingleInstance: NSObject { //在单例类中,有一个用来共享数据的数组 var datas = [St ...