我可以在SalesForce上自定义“编辑自定义对象记录"页面的布局吗? [英] May I customize 'edit custom object records' page layout on SalesForce?

查看:65
本文介绍了我可以在SalesForce上自定义“编辑自定义对象记录"页面的布局吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,要创建或编辑一个对象,当我想在一个特定字段中添加或更改某些值时,我需要引用另一个网站来检索一些信息,这样我可以在其中添加一个按钮或链接吗?编辑页面?

For example, to create or edit an object, when I want to add or change some value to one specific field, I need to refer another website to retrieve some info.In this way, may I add one button or link on the edit page?

SalesForce的帮助链接在这里: https://help.salesforce.com/apex/htviewhelpdoc?id=co_edit.htm&language=zh_CN

The help link of SalesForce is here: https://help.salesforce.com/apex/htviewhelpdoc?id=co_edit.htm&language=en_US

谢谢.

推荐答案

自定义按钮和链接不会显示在新的/编辑页面布局上,因此即使您创建了一个按钮,也仅在局部视图中可见./p>

Custom buttons and links don't display on new/edit page layouts so even if you'd make one, it will be visible only on detail view.

  1. 不太侵入性的选项是创建URL或文本fied,将其默认值设置为链接,确保其显示在页面上但为只读.还没有尝试过,但是应该可以工作(您必须以系统管理员以外的身份对其进行测试,因为您将绕过页面布局的readonly属性).
  2. 更具侵入性的选项是使用Visualforce覆盖新的页面并编辑页面布局.更多工作,但解决方案有些简洁.
  3. 真正疯狂的选择是将一段Javascript嵌入到标准页面布局上的节标题中,甚至嵌入到侧边栏中.这是一个丑陋的骇客,但它确实有效,例如,我已使用它来禁用名称"字段的编辑.


要使用方法3:


To use method #3:

  1. 创建新的节标题,在该节中添加一些内容(空白可以,您需要一些东西,否则将不呈现空白节的标题),将该节标记为仅在编辑页面上可见.
  2. 部分名称最多可包含80个字符,但可以包含类似< script> script.document.getElementById('Name').disabled = true;</script> 的代码.不过,您需要更长的脚本才能以某种方式在运行时创建URL并将其附加到页面中特殊"字段附近的某处.
  3. 使用脚本上传静态资源,然后将其用作部分标题:< script src ="filename.js" type ="text/javascript"></script>
  1. create new section header, add something to the section (blank space is fine, you need something otherwise headers for blank sections aren't rendered), mark the section as visible on edit pages only.
  2. Section name has limit of 80 characters but can contain code like <script>document.getElementById('Name').disabled = true;</script>. You need longer script though to somehow create an URL at runtime and append it somewhere on the page near your "special" field.
  3. Upload a static resource with your script, then use this as the section header: <script src="filename.js" type="text/javascript"></script>


我对这种黑客攻击并不感到骄傲,如果可以的话,请使用自定义的Visualforce new&编辑页面.脏的,可能仅在不允许覆盖页面的情况下才应使用..但它可以工作.


I'm not too proud of this hack and if you can - go with custom Visualforce new & edit page. It's quick & dirty, probably should be used only when you're not allowed to override pages.. but it works.

这篇关于我可以在SalesForce上自定义“编辑自定义对象记录"页面的布局吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆