1 PACKAGE AS_LEAD_ROUTING_WF_CUHK AS
2 /* $Header: asxcldos.pls 120.1 2005/06/05 22:52:11 appldev $ */
3
4 -- Start of Comments
5 -- Package Name : AS_LEAD_ROUTING_WF_CUHK
6 -- Purpose : If user wants to implement custome routing rules,
7 -- create a package body for this spec.
8 -- Note :
9 -- Please do not commit in this package body, once the
10 -- transaction is complete, Oracle Application code
11 -- will issue commit.
12 --
13 -- This user hook will be called while creating and updating
14 -- lead from OSO leads tab, Telesales leads tab, and lead
15 -- import program when routing engine is called.
16 -- The calling package: AS_LEAD_ROUTING_WF.GetOwner.
17 -- History :
18 -- 07/27/2001 SOLIN Created
19 -- End of Comments
20
21 /*-------------------------------------------------------------------------*
22 |
23 | PUBLIC CONSTANTS
24 |
25 *-------------------------------------------------------------------------*/
26
27 /*-------------------------------------------------------------------------*
28 |
29 | PUBLIC DATATYPES
30 |
31 *-------------------------------------------------------------------------*/
32
33 /*-------------------------------------------------------------------------*
34 |
35 | PUBLIC VARIABLES
36 |
37 *-------------------------------------------------------------------------*/
38
39 /*-------------------------------------------------------------------------*
40 |
41 | PUBLIC ROUTINES
42 |
43 *-------------------------------------------------------------------------*/
44
45 -- Start of Comments
46 --
47 -- API name : Get_Owner_Pre
48 -- Parameters :
49 -- IN :
50 -- p_api_version_number: For 11i Oracle Sales application, this is 2.0.
51 -- p_init_msg_list : Initialize message stack or not. It's
52 -- FND_API.G_FALSE by default.
53 -- p_validation_level : Validation level of pass-in value.
54 -- It's FND_API.G_VALID_LEVEL_FULL by default.
55 -- p_commit : Whether commit the whole API at the end of API.
56 -- It's FND_API.G_FALSE by default.
57 --
58 -- The above four parameters are standard input.
59 -- p_resource_id_tbl :
60 -- p_group_id_tbl :
61 -- p_person_id_tbl :
62 -- The above three parameters store the available
63 -- resources for this customized package to decide
64 -- owner of the sales lead. Their datatype is
65 -- TABLE of NUMBERs.
66 -- p_resource_flag_tbl :
67 -- This parameter specify the source of the
68 -- resource.
69 -- 'D': This is default resource, comes from the
70 -- profile AS_DEFAULT_RESOURCE_ID, "OS:
71 -- Default Resource ID used for Sales Lead
72 -- Assignment"
73 -- 'L': This is login user.
74 -- 'T': This resource comes from territory
75 -- definition.
76 --
77 -- If the sales lead matches any territory, the above
78 -- parameters will include all the resources returned
79 -- from territory engine and p_resource_flag_tbl will
80 -- be all 'T'. If it doesn't match any territory:
81 -- 1. Profile "OS: Default Resource ID used for Sales
82 -- Lead Assignment" is set:
83 -- p_resource_id_tbl(1), p_group_id_tbl(1),
84 -- p_person_id_tbl(1) is the default resource
85 -- defined in this profile.
86 -- p_resource_flag_tbl(1)='D'
87 -- p_resource_id_tbl(2), p_group_id_tbl(2),
88 -- p_person_id_tbl(2) is the login user.
89 -- p_resource_flag_tbl(2)='L'
90 -- 2. Profile "OS: Default Resource ID used for Sales
91 -- Lead Assignment" is not set:
92 -- p_resource_id_tbl(1), p_group_id_tbl(1),
93 -- p_person_id_tbl(1) is the login user.
94 -- p_resource_flag_tbl(1)='L'
95 --
96 -- p_sales_lead_rec :
97 -- This is the whole definition of the sales lead.
98 -- This record is provided to help Oracle customer
99 -- decide sales lead owner.
100 -- OUT NOCOPY /* file.sql.39 change */ :
101 -- x_resource_id :
102 -- x_group_id :
103 -- x_person_id :
104 -- The above three parameters store the result
105 -- of this user hook. It will be set as sales
106 -- lead owner. If x_resource_id is NULL, owner
107 -- will be decided based upon Oracle's logic.
108 -- For instance, x_resource_id=1001, x_group_id=10,
109 -- x_person_id=100, it means the resource with
110 -- resource id 1001, group id 10 and person id 100
111 -- will be the owner of the sales lead.
112 -- x_return_status :
113 -- The return status. If your code completes
114 -- successfully, then FND_API.G_RET_STS_SUCCESS
115 -- should be returned; if you get an expected error,
116 -- then return FND_API.G_RET_STS_ERROR; otherwise
117 -- return FND_API.G_RET_STS_UNEXP_ERROR.
118 -- x_msg_count :
119 -- The message count.
120 -- Call FND_MSG_PUB.Count_And_Get to get the message
121 -- count and messages.
122 -- x_msg_data :
123 -- The messages.
124 -- Call FND_MSG_PUB.Count_And_Get to get the message
125 -- count and messages.
126 --
127 -- The above three parameters are standard output
128 -- parameters.
129 --
130 PROCEDURE Get_Owner_Pre(
131 p_api_version_number IN NUMBER,
132 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
133 p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
134 p_commit IN VARCHAR2 := FND_API.G_FALSE,
135 p_resource_id_tbl IN AS_LEAD_ROUTING_WF.NUMBER_TABLE,
136 p_group_id_tbl IN AS_LEAD_ROUTING_WF.NUMBER_TABLE,
137 p_person_id_tbl IN AS_LEAD_ROUTING_WF.NUMBER_TABLE,
138 p_resource_flag_tbl IN AS_LEAD_ROUTING_WF.FLAG_TABLE,
139 p_sales_lead_rec IN AS_SALES_LEADS_PUB.SALES_LEAD_Rec_Type,
140 x_resource_id OUT NOCOPY /* file.sql.39 change */ NUMBER,
141 x_group_id OUT NOCOPY /* file.sql.39 change */ NUMBER,
142 x_person_id OUT NOCOPY /* file.sql.39 change */ NUMBER,
143 x_return_status OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
144 x_msg_count OUT NOCOPY /* file.sql.39 change */ NUMBER,
145 x_msg_data OUT NOCOPY /* file.sql.39 change */ VARCHAR2);
146
147
148 END AS_LEAD_ROUTING_WF_CUHK;
149