I need help with an Apex trigger in Salesforce.com to execute the following (it's too complex for basic workflow rules):
- Utilizing the native Lead Object in Enterprise Edition Salesforce.com
- Indicate 5+ sales agents (Salesforce.com users) to take an incoming lead (out of a pool of 100 sales agents) :: I need the chosen sales agents names and/or unique user id's to be populated in separate fields in the Lead object.
- Each sales agent is assigned to a group, which has a lead limit for each week (8, 10, 12, etc). Here is the reason I need a parent-child or master-detail relationship; I need to tally how many leads an agent has received in real-time.
- Consider the location (U.S. State) of the incoming lead. Because each sales agent is licensed in one or more states.
- Round-Robin Distribution. For example; I don't want a sales agent to reach their weekly limit in one day.
- Overflow leads would be given to one group of sales agents.
This task needs to be completed very quickly (within the NEXT FEW DAYS), so I need someone with extensive experience with Apex and Salesforce.com.
:: Please, include an example of your proposed solution and its process with your application. Please, also indicate whether you believe a custom Object would need to be created to pull this off.