在 Salesforce 中获取帐户的当前产品列表 [英] Getting current product list for an account in Salesforce

查看:46
本文介绍了在 Salesforce 中获取帐户的当前产品列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的一年里,我经常致力于我们的应用程序和 Salesforce 之间的各种类型的集成.我发现我要做的一件事是找出客户当前在其帐户中拥有的所有产品的列表.据我所知,我必须这样做:

  1. 获取帐户的所有机会
  2. 获取这些机会的所有产品 (OpportunityLineItem)
  3. 将它们添加"在一起以获得最终产品列表(当前产品)

我们的销售团队为一个帐户的每个销售活动(无论是新产品、追加销售还是降级)制作一个新的机会,因此理论上您可以有一些这样的机会:

  1. 添加产品 A
  2. 向产品 C 追加销售产品 A
  3. 添加产品 B
  4. 删除产品 C

最终结果(实际当前产品列表)将是简单的产品 B.机会仅代表此帐户 的所有销售的历史数据.

我是一名开发人员.我不知道这是否是进行销售过程的最佳方式——我把它留给他们.但是,我的工作是找到所有当前产品的列表,以便我可以自动将其与我们的计费系统同步.当前的方式(上面概述)似乎笨拙而且不是很有用.它也可能变得非常复杂,并且在不更改代码的情况下很难扩展.例如,如果销售人员要添加新产品,我必须更新代码来处理这些添加.

有什么方法可以让我获得 Account当前 产品列表,而不必遍历每个 机会?

我希望这是有道理的.伪代码可以正常工作,或者您可以指出我可能遗漏的一些文档.

感谢您的时间,伙计们!

解决方案

我认为除了循环获取当前产品列表的机会之外,没有其他方法.

您可能希望创建一个自定义对象来存储帐户到产品的关系,或者您可以构建一个帐户特定的价目表,其中包含仅与该帐户相关的产品.

Over the last year, I've worked often on various types of integration between our app and Salesforce. One of the things that I found that I to do is figure out a list of all the products that a customer currently has in their account. As near as I can tell, I have to do it this way:

  1. Get all the Opportunities for an account
  2. Get all the Products (OpportunityLineItem) for those Opportunities
  3. "Add" them together to get the final Product list (current products)

Our sales team makes a new Opportunity for every sales event for an account (whether it's a new product, an upsell, or a downgrade), so you could theoretically have some opportunities like this:

  1. Add Product A
  2. Upsell Product A to Product C
  3. Add Product B
  4. Remove Product C

The final result (actual current product list) would be simply Product B. The Opportunities just represent the historical data for all the sales that have been made for this Account.

I'm a developer. I don't know if this is the best way to go about the sales process -- I leave that to them. However, it is my job to find a list of all the current products so that I can sync that with our billing system automatically. The current way (outlined above) seems clunky and not very useful. It also could get very complicated and it would get hard to scale without making code changes. For instance, if Sales were to add a new product, I'd have to update the code to handle those additions.

Is there any way I can get a list of the current products for an Account without having to loop through every Opportunity?

I hope that makes sense. Pseudo-code will work fine, or you can point me to some documentation that I may have missed.

Thanks for your time, guys!

解决方案

I don't think there is any other way than looping through the opportunities to get a list of current products.

You may want to look at creating a custom object to store account to product relationship or you could build a account specific price list that has products related to only that account.

这篇关于在 Salesforce 中获取帐户的当前产品列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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