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

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

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

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

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

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

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

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

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

public class CreditLimitController {
//added an instance varaible for the standard controller
private ApexPages.StandardController controller {get; set;}
// the actual account
private Account a; public CreditLimitController(ApexPages.StandardController controller) { //initialize the stanrdard controller
this.controller = controller;
this.a = (Account)controller.getRecord(); system.debug('---------002Account Id ' + this.a.Id);
}
}

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. Longest Increasing Path in a Matrix

    Given an integer matrix, find the length of the longest increasing path. From each cell, you can eit ...

  2. close与shutdown函数

    linux网络编程之socket(十):shutdown 与 close 函数的区别  http://blog.csdn.net/yijiu0711/article/details/17349169 ...

  3. Wince下sqlce数据库开发(一)

    对于Wince下的sqlce数据库虽然很多人在用,但在我查找资料时,却发现资料是多么的匮乏,在此对自己这几天的了解做个简单介绍,希望对大家能有所帮助! 本文的最后附有所使用到的sqlce在wince下 ...

  4. POJ 2503

    http://poj.org/problem?id=2503 题意就是字典翻译.这个输入输出真心恶心,要不是看discuss我肯定是解决不了,还用上了sscanf函数.... 这道题我用几种方法做. ...

  5. NSIS脚本入门和进阶方法

    NSIS(Nullsoft Scriptable Install System)是一个开源的 Windows 系统下安装程序制作程序.它提供了安装.卸载.系统设置.文件解压缩等功能.对于新手来说,它有 ...

  6. 6.SpringMVC注解启用

    SpringMVC注解可以帮助我们快速地注入 属性和参数 提高开发效率. 由于 有相当一部分人讨厌xml配置方式 注解可以覆盖 xml则不能 使用注解比xml规范化,因为很多注解都是java的规范的范 ...

  7. Effective C++ -----条款29:为“异常安全”而努力是值得的

    异常安全函数(Exception-safe functions)即使发生异常也不会泄露资源或允许任何数据结构败坏.这样的函数区分为三种可能的保证:基本型.强烈型.不抛异常型. “强烈保证”往往能够以c ...

  8. [Android Pro] 使用apktool工具遇到could not decode arsc file的解决办法

    转:http://www.cnblogs.com/sage-blog/p/4323049.html 最近使用APKtool工具反编译APK老是提示不成功,错误如下: Exception in thre ...

  9. [Android Pro] How to get recent tasks on Android “L”?

    reference : http://stackoverflow.com/questions/24590533/how-to-get-recent-tasks-on-android-l/2688546 ...

  10. JS返回上一页

    <button  onclick="javascript:history.go(-1);">返回上一页</button> <button  oncli ...