SalesForce:链接自定义字段和帐户活动数据
我正在慢慢掌握销售人员的窍门,并且正在尝试将一些领域连接到客户和机会等方面。
我当前的问题是帐户活动详细信息。我有一组帐户,显示与该帐户相关的数据和详细信息,例如:
帐户所有者 帐户名称 类型 网站 电话号码 以及更多...
在此帐户中,我们有一个活动源,其中提供了链接到该帐户的电话、会议或电子邮件的详细信息。帐户活动中的每个事件都有一个 Type
字段,可以是:会议、呼叫或电子邮件。
我想要做的是在主帐户中创建一个自定义字段,该字段查看帐户活动,并显示上次会议的日期,因此就 sudo 代码而言,它会类似于:
SELECT DueDate WHERE type =Meeting 和 DueDate <= TODAY()
或者类似的东西(我知道这基本上是 SQL)。
如果有人能帮忙那就太棒了,特别是下午 5 点,因为我的老板说如果我搞清楚的话他会给我买一品脱!
谢谢大家。
---------- 编辑---------
我正在尝试这样的事情:
CASE(TEXT(Activity.Type), 会议,今天 - LastActivityDate)
在创建客户公式字段时,因此我尝试通过执行以下操作来访问名为 Type 的事件字段:
Activity.Type
这不起作用,但这是从 LastActivityDate 中获取的猜测。我可能做错了,所以任何事情都会有所帮助。干杯!
---------- 编辑 ---------
I am slowly getting the hang of salesforce and I am trying to get some fields linking up between accounts and opportunities and more.
My current issue is with Account Activity details. I have a set of accounts which show data and details connected to the account such as:
Account Owner
Account Name
Type
Website
Phone number
and more...
In this account we have a feed of activity which give details of phone calls, meetings or emails which link to the account. Each event within the account activity has a Type
field which is either: Meeting, Call or Email.
What I am trying to do is create a Custom Field within the main account which looks at the account activity, and displays the date of the last meeting, so in terms of sudo code it would be something like:
SELECT DueDate WHERE type=Meeting and DueDate <= TODAY()
Or something along these lines (I know thats basically SQL).
If anyone could help that would be brilliant, specially by 5pm as my boss said he would buy me a pint if I get it figured out!
Thanks all.
---------- EDIT ---------
I am trying something like this:
CASE(TEXT(Activity.Type),
Meeting, TODAY - LastActivityDate)
when creating a custome formula field, so im trying to get to the Event field called Type by doing:
Activity.Type
This does not work but it was a guess which was taken from LastActivityDate. I may be going about this all wrong, so anything will help. cheers!
---------- EDIT ---------
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能使用公式来做到这一点,也不能真正使用 LastActivityDate 字段,因为它跟踪所有类型的事件,而不仅仅是“会议”。
实现此目的的一种方法是在事件对象上创建插入后/更新后触发器,这将更新帐户上的“Last_Meeting_Date__c”字段(您将需要创建该字段)。
这是代码:
我没有尝试部署它,所以不确定它是否会要求您增加此触发器的代码覆盖率。您可能必须为其创建一个测试类。
You cannot do that with a formula, and you can't really use LastActivityDate field, because it tracks ALL types of events, not just "Meeting".
One way to accomplish this is to create an after-insert/after-update trigger on the Event object, which would update the "Last_Meeting_Date__c" field on the Account (you will need to create that field).
Here is the code:
I didn't try to deploy it, so not sure if it will ask you to increase code coverage for this trigger. You may have to create a test class for it.