循环分配实施(数据库)
我目前正在为 SalesLead
实现多种不同的分配算法<--> 销售人员
情况。 总体思路非常简单:
SalesLead
在公共网站上注册代码自动生成使用循环调度将
SalesLead
分配给SalesPerson
(潜在客户以相同的顺序分配给SalesPersons
)
我有一些认真的编码员- 阻止如何实际执行此操作,确保每次都以相同的顺序从数据库中提取代理,并使用另一个表来存储分配了 SalesLead 的最后一个代理(这实际上可能对构建报告有用) ,或者至少稍后有一个回溯方法)。 我离基地太远了吗?
说明:该代码目前无法将销售人员与潜在客户进行匹配。 这是一个全新的功能。 目前,他们可以注册特定的销售人员,但我们希望他们能够自动分配。
I'm currently in the process of implementing a number of different assignment algorithms for a SalesLead
<--> SalesPerson
situation. The general idea is quite simple:
A
SalesLead
signs up on a public websiteThe code automatically assigns the
SalesLead
to aSalesPerson
using round-robin scheduling (Leads are assigned toSalesPersons
in the same order)
I'm having some serious coders-block in how to actually perform this outside of making sure I pull the agents from the database in the same order each time, and using another table to store the last agent that was assigned a SalesLead (which may actually be useful for building a report, or at least having a trace-back method later on). Am I way off base?
Clarification: The code doesn't currently match a sales person to a lead. This is a completely new function. Currently they can sign up for a specific SalesPerson, but we'd like them to be able to be assigned automatically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
非常简单:当创建 SalesPerson 时,给他们一个 LastActivityDate。 当他们被分配销售线索时,将该日期更新为当前日期。 将收到的销售线索提供给活动日期最近的销售人员。
可以通过 SQL 或代码轻松完成。
Pretty simple really: when a SalesPerson is created, give them a LastActivityDate. When they are assigned a SalesLead, update that date to the current date. Give a SalesLead, as it comes in, to a SalesPerson with the least recent activity date.
Can be done easily in SQL or code.
如果您有一个将 SalesLeads 和 SalesPersons 匹配在一起的表,并为其添加了时间戳,则不需要单独的表来跟踪最后选择的 SalesPerson。
If you have a table that matches SalesLeads and SalesPersons together and you timestamp it, you don't need a separate table to keep track of the last SalesPerson picked.
在 SQL Server 中,您实际上希望它是日期时间,而不是时间戳字段,但@David 的想法是相同的。 跟踪分配给销售人员的最后一个销售线索并记录分配的时间。 然后,您可以通过查找未分配潜在客户的销售人员或最后分配的潜在客户最早的销售人员来选择要分配潜在客户的下一个销售人员。
In SQL Server you'd actually want it to be a datetime, not a timestamp field, but @David's idea is the same. Keep track of the last sales lead assigned to a sales person and record the time at which it was assigned. You can then pick the next sales person to assign a lead to by finding the sales person who does not have one assigned or the sales person whose last assigned lead is the oldest.
看看 Salesforce 是如何做到的:
http://forums.sforce.com/ sforce/board/message?board.id=custom_formula&message.id=533
按销售人员的数量 + 1 修改 ID,然后将 1 分配给 Joe,2 分配给 Tom,等等。
Check out how Salesforce does it:
http://forums.sforce.com/sforce/board/message?board.id=custom_formula&message.id=533
MOD an ID by the number of salespeople + 1 and then assign 1 to Joe, 2, to Tom, etc.