比较 salesforce 中的两个视图

发布于 2024-12-25 21:09:53 字数 628 浏览 3 评论 0原文

我正在寻找一种方法来比较销售人员中的两种视图。我想创建一个视觉强制页面,让用户选择与帐户对象关联的两个视图,并显示两个视图上出现的所有帐户。

我在这里很挣扎,我不知道如何从视图中获取结果,但我希望有一种方法可以获取与每个视图的过滤器匹配的所有帐户。

这是我的 SOQL 查询:

 Select Id, Name, Owner.Name  FROM Account WHERE
    Id IN ( SELECT AccountId FROM Opportunity WHERE RecordTypeId = :RecordType1ID  AND StageName IN :StageOneList )
    AND Id IN ( SELECT AccountId FROM Opportunity WHERE RecordTypeId = :RecordType2ID AND StageName IN :StageTwoList )

这是我迄今为止制作的 VF 页面的基础。可以使用帐户所有者和省份的下拉列表来过滤帐户。这个想法是,组织中的许多人已经创建了视图,并根据需要过滤了帐户。我不想将每个可能的帐户字段作为过滤器,而是想要一个与帐户关联的活动用户视图的下拉列表,然后他们可以选择机会 1 和机会 2 并获得匹配的帐户列表。

I am looking for a way to compare two views in salesforce. I want to create a visual force page that lets a user select two views associated with the Account object and show all the accounts that appear on both views.

I am struggling pretty hard here, I can't figure out how to get the results from the views, but I am hoping there is a way to get all accounts that match the filters for each view.

Here is my SOQL query:

 Select Id, Name, Owner.Name  FROM Account WHERE
    Id IN ( SELECT AccountId FROM Opportunity WHERE RecordTypeId = :RecordType1ID  AND StageName IN :StageOneList )
    AND Id IN ( SELECT AccountId FROM Opportunity WHERE RecordTypeId = :RecordType2ID AND StageName IN :StageTwoList )

This is the basis of the VF page I have made so far. It is possible to filter the Account with Account Owner and a drop down list from province. The idea is, many people in the organization have already created views with the accounts filtered as they need it. Instead of including every possible account field as a filter, I would like a drop down list of the active users views associated with Account, and then they can select Opportunity 1 and Opportunity 2 and have a list of Accounts matching.

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

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

发布评论

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

评论(3

深白境迁sunset 2025-01-01 21:09:53

我假设您的意思是对象标准选项卡上下拉框中的可用视图中的视图?如果是这样,我不相信您可以直接查询结果,尽管您可以使用提供过滤器的 SOQL 语句查询 Account 对象。

我的建议是创建一个设置 VF 页面,其中有 2 个下拉菜单来切换用于返回所显示帐户列表的 SOQL 查询(这意味着您有一组预先确定的视图,并且对它们的更新需要代码更新)或提供有关您的用例的更多详细信息,我们也许可以提供其他建议。

I assume you mean views as in the available views in the dropdown box on a standard tab for an object? If so I don't believe you can query the results from them directly although you can query the Account object using a SOQL statement where you provide the filter.

My suggestion would be either create a set VF page that has 2 drop downs to switch the SOQL query that is used to return the list of accounts being displayed (would mean you have a set of predetermined views and updates to them require code updates) or give more details of your use case and we may be able to provide other suggestions.

赢得她心 2025-01-01 21:09:53

听起来您只需要在这里比较过滤器的结果即可。我的建议是,您确实正在尝试做一些应该通过报告而不是视图来完成的事情。

It sounds like you just need to compare the results of the filters here. My suggestion would be that you're really trying to do something that should be done with reports, not with views.

岁月静好 2025-01-01 21:09:53

放置两个 enhancedList页面上的组件。

Put two enhancedList components on the page.

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