Use this procedure to set up the application to automatically assign resources to a lead whenever an agent or salesperson creates or updates the lead.
Prerequisites None
Responsibility
Forms - Oracle Sales Administrator
Navigation
Forms - Profiles > System
Campaign (was 20) Equals E-business
Rule 1 (A+)
Contact Role (was 20) Total Budget (was 50) Purchase Timeframe (was 30) Sales Channel (was 20) Budget Status (was 10) (total = 150)
Rule 2 (A)
Contact Role (was 20) Budget Amount (was 50) Budget Status (was 10) (total = 120)
Steps
1. To enable automatic lead assignment, make sure that the system profile option OS: Assign New Lead is set to N. This is the default seeded value.
When this profile is set to N, a call to the Territory Manager API automatically assigns resources to the lead using the territories defined in Territory Manager.
The first person the program assigns becomes the lead owner. The rest of the resources in the territory become sales team members on the lead.
If the lead creator is a valid sales agent or salesperson, the lead creator is added to the lead sales team when the lead is created.
2. For qualified and indirect leads, if the profile OS: Auto Convert Lead to Opportunity is set to Y, an opportunity is created, and partner matching workflow is launched.
3. For unqualified leads, if the channel is equal to the profile OS: Lead Incubation Channel, the lead owner is determined by immature lead assignment.
4. Set up the default resource to handle any leads that are not matched to any territory in the system profile option OS: Default Resource ID Used for Sales Lead Assignment.
If there is no matching territory, then the application assigns the lead to the default resource set in this profile option. If you do not set this profile option, then the application assigns the lead to the agent or salesperson who created or updated the lead.
5. If the territories in your organization use agent availability as one of the criteria for assigning agents, then setting the profile OS: Calendar Setting Required for Assignment to Yes enables the automatic assignment of lead owners based on availability. If you are using agent availability for assigning lead ownership,
Note: If the leads are processed by the Lead Rules Engine, a lead sales team is built only for qualified leads.
Note: If both the resource in OS: Default Resource ID Used for Sales Lead Assignment and the user who created or updated the lead do not have a valid sales role assigned to them, then the leads you import will not be accessible from either Oracle Sales Online or Oracle TeleSales.
For more details, see the Oracle CRM Application Foundation Implementation Guide, Implementing Calendar.
6. Optionally, you can implement custom rules for lead assignment by implementing the Lead Routing Engine user hook described below.
Lead Routing Engine
Hook Name: AS_LEAD_ROUTING_WF
Package Name: AS_LEAD_ROUTING_WF_CUHK
Purpose
If you are implementing custom lead routing rules, then create a package body according to these specifications.
This user hook will be called when an agent or salesperson is creating and updating a lead in the Lead tab, and from the Import Sales Lead concurrent program
whenever the routing engine is called.
The calling package is AS_LEAD_ROUTING_WF.GetOwner.
API name Get_Owner_Pre
In Parameters
Table 2–21 lists the standard input parameters.
Note: Do not commit in this package body. After the transaction is complete, Oracle application code will issue a commit.
Table 2–21 Standard Input parameters
Parameter Description
p_api_version_number For 11i Oracle Sales applications, this is set to 2.0.
p_init_msg_list Initialize message stack or not. Set to FND_API.G_FALSE by default.
The following three parameters store the available resources for this customized package to decide the owner of the sales lead. Their data type is TABLE of NUMBERs.
■ p_resource_id_tbl
■ p_group_id_tbl
■ p_person_id_tbl
Table 2–22 lists other input parameters.
p_validation_level Validation level of pass-in value. Set to FND_API.G_VALID_
LEVEL_FULL by default.
p_commit Whether commit the whole API at the end of API. Set to FND_
API.G_FALSE by default.
Table 2–21 Standard Input parameters
Parameter Description
Out Parameters
The following three parameters store the result of this user hook:
■ x_resource_id
■ x_group_id
■ x_person_id
Together these set the sales lead owner.
p_resource_flag_tbl This parameter specifies the source of the resource:
■ D: Default resource from the profile AS_DEFAULT_
RESOURCE_ID, OS: Default Resource ID used for Sales Lead Assignment.
■ L: Login user.
■ T: Territory definition.
If the sales lead matches any territory, the above parameters will include all the resources returned from territory engine and p_resource_flag_tbl will be all T.
If the sales lead does not match any territory:
1. Profile OS: Default Resource ID used for Sales Lead Assignment is set:
■ p_resource_id_tbl(1), p_group_id_tbl(1), p_person_id_
tbl(1) is the default resource defined in this profile.
■ p_resource_flag_tbl(1)=D
■ p_resource_id_tbl(2), p_group_id_tbl(2), p_person_id_
tbl(2) is the login user.
■ p_resource_flag_tbl(2)=L
2. Profile OS: Default Resource ID used for Sales Lead Assignment is not set:
■ p_resource_id_tbl(1), p_group_id_tbl(1)
■ p_person_id_tbl(1) is the login user
■ p_resource_flag_tbl(1)=L
p_sales_lead_rec This provides the whole definition of a sales lead. This record is provided to help an Oracle customer decide the sales lead owner.
If x_resource_id is NULL, the owner is decided based upon Oracle's logic.
For instance, x_resource_id=1001, x_group_id=10, x_person_id=100. The resource with the resource ID 1001, group ID 10, and person ID 100 is assigned as the owner of the sales lead.
Table 2–23 lists the standard output parameters.