Visualforce 自定义查找 Visualforce 页面

发布于 2024-12-22 06:57:09 字数 358 浏览 2 评论 0原文

我想知道是否有一种方法可以覆盖 Salesforce 中查找字段的本机功能并将其替换为 Visualforce 页面。我尝试覆盖此按钮的原因是,当用户进行查找时,查找会返回具有该名称的每个人。我们想要返回的是正在搜索的联系人的按帐户列出的所有联系人的列表。

这就是我想要实现的目标:

当用户单击查找按钮时,我的 Visualforce 页面将启动并允许用户查看该帐户以及该帐户的所有联系人。

这可能吗?您建议采取哪些其他方法来解决这个问题?

这是我尝试更改的屏幕截图:

在此处输入图像描述

感谢您的帮助!

I was wondering if there is a way to override the native functionality of the lookup field in Salesforce and replace it with a visualforce page. The reason I'm trying to override this button is because when the user does a look up, the look up returns everybody with that name. What we want to return is a list of all the contacts by account for the contact being searched.

Here's what I'm trying to achieve:

When the user clicks the lookup button my visualforce page will launch and allow the user to see the account and all the contacts of that account.

Is this even possible? What other ways would you suggest going about this?

Here's a screen shot of what I'm trying to change:

enter image description here

Thanks for all your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

篱下浅笙歌 2024-12-29 06:57:09

听起来确实像您只需要自定义查找中的列以使其更适合您的需求。如果您进入设置 ->定制->联系方式->搜索布局,您将看到查找对话框和查找电话对话框的条目,您可以在其中编辑查找窗口中显示的列。

如果您确实需要自定义解决方案:

您无法覆盖查找页面本身,但您可以使用 和其他类似标签为您的帐户创建一个新的 Visualforce 页面你的生活更简单。然后,您可以在下面添加一个搜索部分,用户可以在其中输入各种搜索词,您将这些搜索词放入动态 SOQL 查询中,然后呈现结果以供他们选择。

It sounds really like you just need to customise the columns on the lookup to make it better suited to your needs. If you go to Setup -> Customize -> Contacts -> Search Layouts, you'll see entries for Lookup Dialogs and Lookup Phone Dialogs, there you can edit the columns displayed in the lookup windows.

If you really need a custom solution:

You can't override the lookup page itself, but you could create a new visualforce page for your account, using <apex:detail> and other similar tags to make your life simpler. Then you could include a search section underneath, where a user can enter various search terms which you put into a dynamic SOQL query and then render the results for them to choose from.

陈年往事 2024-12-29 06:57:09

是的,它可以通过 javascript 实现,就像我通过 Visual Force 页面所做的那样,它将显示相关列表的记录,并在选择该记录的 ID 后通过 jscipt 传递到父窗口。并执行相同的功能..

yeah its possible by javascript as i did by visual force page that will show the records of related lists and upon selection id of that record passed to parent window by jscipt. and performed same functionality ..

挽清梦 2024-12-29 06:57:09

据我所知 - 不。
作为解决方法,您可以使用 JavaScript。
我们在我们的情况下做了什么?我们用 JavaScript 实现一切。我们创建了一个 inputText,并在该 inputText 的右侧放置了带有此查找图标的图像。在图像上单击我们创建 ExtJS 弹出窗口(我认为您可以简单地创建 VF 页面并在弹出窗口中显示此页面)。窗口关闭后,您填写 inputText 字段。

As far as I know - NO.
As a workaround you can use JavaScript.
What we did in our situation? We implement everything in JavaScript. We created an inputText and right on the right of this inputText we placed image with this lookup icon. On image click we create ExtJS popup window (I think you can simply create VF page and show this page in popup window). After window was closed you fill in the inputText field.

唔猫 2024-12-29 06:57:09

我上次检查时,此按钮没有开箱即用的覆盖,因此需要自定义一些内容。如果您设置弹出窗口并且不想要内联解决方案,我建议您查看 本教程来熟悉 Visualforce 中弹出窗口的一些问题。

但考虑到您希望实现的目标,当用户单击新的自定义搜索按钮时,您还可以将您的帐户以及与该帐户关联的所有联系人的筛选列表内联显示在您的页面上。当然,该页面本身将位于 Visualforce 中(或标准页面布局中的内联 Visualforce) - 您可能希望也可能不想对其进行编码和维护。

AJAX 工具包 也可能是一个不错的起点,如果您想要将自定义 JavaScript 按钮放置在标准页面布局上。

There's no out-of-the-box override for this button, last I checked, so something custom would be required. If you're set on having a popup and do not want an inline solution, I'd recommend reviewing this tutorial to get familiar with some of the issues with popups in Visualforce.

But considering what you are looking to accomplish, you could also have your account and filtered list of all contacts associated with that account appear inline on your page when the user clicks a new, custom search button. Of course that page would itself be in Visualforce (or inline Visualforce in a standard page layout) - which you may or may not want to have to code and maintain.

The AJAX Toolkit might also be a good place to start if you want to go with a custom JavaScript button placed on a standard page layout.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文