将自定义链接/按钮添加到 Visualforce 页面?
我在机会对象上有一个指向外部站点的自定义链接。是否可以将此自定义链接添加到 Visualforce 页面?
我想出的解决方案是复制 salesforce 为此自定义链接创建的 url,并将其粘贴到页面中。它看起来像这样:
<a href="https://{!hostname}/servlet/servlet.Integration?lid=00bE0000000YbK3&eid={!opportunity.Id}&ic=1">my custom link</a>
这工作正常,但是,一旦它位于安装在其他服务器上的托管包中,它就无法工作,因为盖子参数将不同(自定义链接 ID)。有解决办法吗?
I have a custom link on the opportunity object which points to an external site. Is it possible to add this custom link to a visualforce page?
The solution I came up with was to copy the url salesforce creates for this custom link, and paste it in the page. It looks something like this:
<a href="https://{!hostname}/servlet/servlet.Integration?lid=00bE0000000YbK3&eid={!opportunity.Id}&ic=1">my custom link</a>
This works fine, however, it won't work once it's in a managed package installed on other servers because the lid param will be different (the custom link id). Is there a solution for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否考虑过将链接的 URL 放入机会对象的字段中,然后在 VF 页面上创建输出链接?
保罗
Have you thought about putting the URL of the link in a field on the opportunity object and then creating an output link on your VF page?
Paul
查看 $Action 下的内容。按钮和链接可通过该全局变量使用。例如
$Action.Opportunity.CustomLink
Look under $Action. Buttons and links are available via that global variable. For example
$Action.Opportunity.CustomLink
为了构建 danieljimenez 的答案,
$Action
全局变量提供对按钮/链接对象的访问。从那里,您需要使用URLFOR
函数将其转换为可用的形式。然后,您可以将其放入命令按钮的action
参数中,或者在标记中的其他任何位置使用它。或者
To build off the answer from danieljimenez, the
$Action
global variable provides access to the button/link objects. From there you need to use theURLFOR
function to get it into a usable form. Then you can either put it into theaction
param of a command button, or use it as you'd like anywhere else in your markup.or
创建新联系人(Salesforce 按钮目标_blank)
create New Contact (Salesforce button target _blank)