86: END IF;
87:
88: -- Debug Message
89: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
90: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
91: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Roletype: ' || p_notify_type ||
92: '. Itemtype: ' || p_itemtype || '. p_assignemnt_status: ' || p_assignment_status);
93: fnd_msg_pub.Add;
94: END IF;
87:
88: -- Debug Message
89: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
90: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
91: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Roletype: ' || p_notify_type ||
92: '. Itemtype: ' || p_itemtype || '. p_assignemnt_status: ' || p_assignment_status);
93: fnd_msg_pub.Add;
94: END IF;
95:
118:
119:
120: -- Debug Message
121: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
122: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
123: if l_exist_rolename is null then
124: fnd_message.Set_token('TEXT', 'Creating role: '||l_adhoc_role||' with members :--');
125: else
126: fnd_message.Set_token('TEXT', 'Adding to role: '||l_adhoc_role||' with members :--');
120: -- Debug Message
121: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
122: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
123: if l_exist_rolename is null then
124: fnd_message.Set_token('TEXT', 'Creating role: '||l_adhoc_role||' with members :--');
125: else
126: fnd_message.Set_token('TEXT', 'Adding to role: '||l_adhoc_role||' with members :--');
127: end if;
128: fnd_msg_pub.Add;
122: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
123: if l_exist_rolename is null then
124: fnd_message.Set_token('TEXT', 'Creating role: '||l_adhoc_role||' with members :--');
125: else
126: fnd_message.Set_token('TEXT', 'Adding to role: '||l_adhoc_role||' with members :--');
127: end if;
128: fnd_msg_pub.Add;
129: END IF;
130:
133:
134:
135:
136: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
137: fnd_message.Set_token('TEXT', l_role_list(i) );
138: fnd_msg_pub.Add;
139: END IF;
140:
141: END LOOP;
154: x_roleName := l_adhoc_role;
155:
156: else
157:
158: fnd_message.SET_NAME('PV', 'PV_EMPTY_ROLE');
159: fnd_msg_pub.ADD;
160:
161: raise FND_API.G_EXC_ERROR;
162:
260: END IF;
261:
262: -- Debug Message
263: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
264: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
265: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || p_from_status || p_to_status);
266: fnd_msg_pub.Add;
267: END IF;
268:
261:
262: -- Debug Message
263: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
264: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
265: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || p_from_status || p_to_status);
266: fnd_msg_pub.Add;
267: END IF;
268:
269: x_return_status := FND_API.G_RET_STS_SUCCESS ;
271: -- check the profile value and return if the value is not Y
272: l_email_enabled := nvl(fnd_profile.value('PV_EMAIL_NOTIFICATION_FLAG'), 'Y');
273:
274: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
275: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
276: fnd_message.Set_Token('TEXT', 'Email Notication is Enabled '||l_email_enabled);
277: fnd_msg_pub.Add;
278: END IF;
279:
272: l_email_enabled := nvl(fnd_profile.value('PV_EMAIL_NOTIFICATION_FLAG'), 'Y');
273:
274: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
275: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
276: fnd_message.Set_Token('TEXT', 'Email Notication is Enabled '||l_email_enabled);
277: fnd_msg_pub.Add;
278: END IF;
279:
280: if (l_email_enabled <> 'Y') then
280: if (l_email_enabled <> 'Y') then
281: return;
282: else
283: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
284: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
285: fnd_message.Set_Token('TEXT', 'Email Notication is Enabled ');
286: fnd_msg_pub.Add;
287: END IF;
288: end if;
281: return;
282: else
283: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
284: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
285: fnd_message.Set_Token('TEXT', 'Email Notication is Enabled ');
286: fnd_msg_pub.Add;
287: END IF;
288: end if;
289:
293: FOR i in 1 .. p_user_name_tbl.count
294: LOOP
295:
296: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
297: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
298: fnd_message.Set_Token('TEXT', 'In Loop of p_user_name_tbl '||p_user_name_tbl(i));
299: fnd_msg_pub.Add;
300: END IF;
301:
294: LOOP
295:
296: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
297: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
298: fnd_message.Set_Token('TEXT', 'In Loop of p_user_name_tbl '||p_user_name_tbl(i));
299: fnd_msg_pub.Add;
300: END IF;
301:
302: IF p_user_type_tbl(i) = 'AM' THEN
503: raise FND_API.G_EXC_ERROR;
504: end if;
505:
506: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
507: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
508: fnd_message.Set_token('TEXT', 'After Checkforerror');
509: fnd_msg_pub.Add;
510: END IF;
511: END IF;
504: end if;
505:
506: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
507: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
508: fnd_message.Set_token('TEXT', 'After Checkforerror');
509: fnd_msg_pub.Add;
510: END IF;
511: END IF;
512:
993: END IF;
994:
995: -- If Channel manager found create assignment and notification record
996: If l_rs_details_tbl.count <= 0 THEN
997: FND_MESSAGE.set_name('PV', 'PV_EMPTY_ROLE');
998: FND_MSG_PUB.add;
999: RAISE FND_API.g_exc_unexpected_error;
1000: ELSE
1001: -- Insert into table PV_LEAD_ASSIGNMENTS with STATUS to PT_CREATED.
1142: end;
1143:
1144: if l_sales_group_id is NULL then
1145:
1146: fnd_message.SET_NAME ('PV', 'PV_DEBUG_MESSAGE');
1147: fnd_message.SET_TOKEN ('TEXT' , 'No Default Sales Group for resource id '||
1148: l_rs_details_tbl(i).resource_id);
1149: fnd_msg_pub.ADD;
1150:
1143:
1144: if l_sales_group_id is NULL then
1145:
1146: fnd_message.SET_NAME ('PV', 'PV_DEBUG_MESSAGE');
1147: fnd_message.SET_TOKEN ('TEXT' , 'No Default Sales Group for resource id '||
1148: l_rs_details_tbl(i).resource_id);
1149: fnd_msg_pub.ADD;
1150:
1151: fnd_message.SET_NAME ('PV', 'PV_DEBUG_MESSAGE');
1147: fnd_message.SET_TOKEN ('TEXT' , 'No Default Sales Group for resource id '||
1148: l_rs_details_tbl(i).resource_id);
1149: fnd_msg_pub.ADD;
1150:
1151: fnd_message.SET_NAME ('PV', 'PV_DEBUG_MESSAGE');
1152: fnd_message.SET_TOKEN ('TEXT' , 'Not adding to oppty salesteam: '||l_rs_details_tbl(i).user_name);
1153: fnd_msg_pub.ADD;
1154:
1155: else
1148: l_rs_details_tbl(i).resource_id);
1149: fnd_msg_pub.ADD;
1150:
1151: fnd_message.SET_NAME ('PV', 'PV_DEBUG_MESSAGE');
1152: fnd_message.SET_TOKEN ('TEXT' , 'Not adding to oppty salesteam: '||l_rs_details_tbl(i).user_name);
1153: fnd_msg_pub.ADD;
1154:
1155: else
1156:
1175: RAISE FND_API.G_EXC_ERROR;
1176: END IF;
1177:
1178: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1179: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1180: fnd_message.Set_Token('TEXT', 'After 1st Create Sales team');
1181: fnd_msg_pub.Add;
1182: END IF;
1183:
1176: END IF;
1177:
1178: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1179: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1180: fnd_message.Set_Token('TEXT', 'After 1st Create Sales team');
1181: fnd_msg_pub.Add;
1182: END IF;
1183:
1184: end if;
1195: INTO l_address_id, l_partner_resource_id;
1196: CLOSE lc_address;
1197:
1198: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1199: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1200: fnd_message.Set_Token('TEXT', 'Salesgroup ID'||l_sales_team_rec.sales_group_id);
1201: fnd_msg_pub.Add;
1202: END IF;
1203:
1196: CLOSE lc_address;
1197:
1198: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1199: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1200: fnd_message.Set_Token('TEXT', 'Salesgroup ID'||l_sales_team_rec.sales_group_id);
1201: fnd_msg_pub.Add;
1202: END IF;
1203:
1204: l_sales_team_rec.sales_group_id := null;
1278:
1279: END IF;
1280:
1281: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1282: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1283: fnd_message.Set_Token('TEXT', 'After 2nd Create Sales team');
1284: fnd_msg_pub.Add;
1285: END IF;
1286:
1279: END IF;
1280:
1281: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1282: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1283: fnd_message.Set_Token('TEXT', 'After 2nd Create Sales team');
1284: fnd_msg_pub.Add;
1285: END IF;
1286:
1287: -- Update AS_LEADS_ALL set AUTO_ASSIGNMENT_TYPE in AS_LEADS_ALL to PRM for the lead_id.
1346: RAISE FND_API.G_EXC_ERROR;
1347: END IF;
1348:
1349: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1350: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1351: fnd_message.Set_Token('TEXT', 'After Workflow is started');
1352: fnd_msg_pub.Add;
1353: END IF;
1354:
1347: END IF;
1348:
1349: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1350: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1351: fnd_message.Set_Token('TEXT', 'After Workflow is started');
1352: fnd_msg_pub.Add;
1353: END IF;
1354:
1355: -- Call the following procedure to see whether workflow was able to send notification successfully.
1419:
1420: BEGIN
1421:
1422: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1423: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1424: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || ' Funcmode: ' || funcmode);
1425: fnd_msg_pub.Add;
1426: END IF;
1427:
1420: BEGIN
1421:
1422: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1423: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1424: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || ' Funcmode: ' || funcmode);
1425: fnd_msg_pub.Add;
1426: END IF;
1427:
1428: IF (funcmode = 'RUN') then
1514: END IF;
1515:
1516: -- Debug Message
1517: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1518: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1519: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
1520: fnd_msg_pub.Add;
1521: END IF;
1522:
1515:
1516: -- Debug Message
1517: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1518: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1519: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
1520: fnd_msg_pub.Add;
1521: END IF;
1522:
1523: -- Initialize API return status to success
1572: p_data => x_msg_data);
1573:
1574: WHEN OTHERS THEN
1575: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1576: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1577: fnd_message.Set_Token('TEXT', sqlcode||sqlerrm);
1578: fnd_msg_pub.Add;
1579: END IF;
1580:
1573:
1574: WHEN OTHERS THEN
1575: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1576: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1577: fnd_message.Set_Token('TEXT', sqlcode||sqlerrm);
1578: fnd_msg_pub.Add;
1579: END IF;
1580:
1581: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1806: END IF;
1807:
1808: -- Debug Message
1809: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1810: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1811: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
1812: fnd_msg_pub.Add;
1813: END IF;
1814:
1807:
1808: -- Debug Message
1809: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1810: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1811: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
1812: fnd_msg_pub.Add;
1813: END IF;
1814:
1815: -- Initialize API return status to success
1838: END IF;
1839:
1840: -- Debug Message
1841: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1842: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1843: fnd_message.Set_Token('TEXT', 'After Found : ' || l_creating_username || ' salesforce id : ' || p_salesforce_id);
1844: fnd_msg_pub.Add;
1845: END IF;
1846:
1839:
1840: -- Debug Message
1841: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1842: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1843: fnd_message.Set_Token('TEXT', 'After Found : ' || l_creating_username || ' salesforce id : ' || p_salesforce_id);
1844: fnd_msg_pub.Add;
1845: END IF;
1846:
1847: -- Get the Opportunity Status from header and table
1846:
1847: -- Get the Opportunity Status from header and table
1848: -- IF Status is changed
1849: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1850: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1851: fnd_message.Set_Token('TEXT', 'Status '||l_status);
1852: fnd_msg_pub.Add;
1853: END IF;
1854:
1847: -- Get the Opportunity Status from header and table
1848: -- IF Status is changed
1849: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1850: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1851: fnd_message.Set_Token('TEXT', 'Status '||l_status);
1852: fnd_msg_pub.Add;
1853: END IF;
1854:
1855: IF l_status is null THEN
1875: end loop;
1876: close lc_get_meaning;
1877:
1878: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1879: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1880: fnd_message.Set_Token('TEXT', 'STATUS before : ' || l_from_status || ', After : ' || l_to_status);
1881: fnd_msg_pub.Add;
1882: END IF;
1883:
1876: close lc_get_meaning;
1877:
1878: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1879: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1880: fnd_message.Set_Token('TEXT', 'STATUS before : ' || l_from_status || ', After : ' || l_to_status);
1881: fnd_msg_pub.Add;
1882: END IF;
1883:
1884: IF l_from_status IS NULL OR l_to_status IS NULL THEN
1919:
1920: if l_message_name is not null then
1921:
1922: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1923: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
1924: fnd_message.Set_token('TEXT', 'Logging status change message: ' || l_message_name ||
1925: ' for lead_id:' || l_lead_id || ' by resource:' || p_salesforce_id);
1926: fnd_msg_pub.Add;
1927: END IF;
1920: if l_message_name is not null then
1921:
1922: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1923: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
1924: fnd_message.Set_token('TEXT', 'Logging status change message: ' || l_message_name ||
1925: ' for lead_id:' || l_lead_id || ' by resource:' || p_salesforce_id);
1926: fnd_msg_pub.Add;
1927: END IF;
1928:
1954: CLOSE lc_status_notify;
1955:
1956: -- Debug Message
1957: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1958: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1959: fnd_message.Set_Token('TEXT', 'After PV Party Notification : ' || l_notify_pt_flag || l_notify_am_flag ||
1960: l_notify_cm_flag || l_notify_others_flag);
1961: fnd_msg_pub.Add;
1962: END IF;
1955:
1956: -- Debug Message
1957: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1958: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1959: fnd_message.Set_Token('TEXT', 'After PV Party Notification : ' || l_notify_pt_flag || l_notify_am_flag ||
1960: l_notify_cm_flag || l_notify_others_flag);
1961: fnd_msg_pub.Add;
1962: END IF;
1963:
1987: CLOSE lc_users;
1988:
1989: -- Debug Message
1990: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1991: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1992: fnd_message.Set_Token('TEXT', 'Total number of parties to be notified : ' ||
1993: l_user_name_tbl.count || ' lead_id : ' || l_lead_id);
1994: fnd_msg_pub.Add;
1995: END IF;
1988:
1989: -- Debug Message
1990: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1991: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1992: fnd_message.Set_Token('TEXT', 'Total number of parties to be notified : ' ||
1993: l_user_name_tbl.count || ' lead_id : ' || l_lead_id);
1994: fnd_msg_pub.Add;
1995: END IF;
1996:
2001:
2002: l_opp_amt_curncy := l_opp_amt ||' '||l_currency_code;
2003:
2004: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2005: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2006: fnd_message.Set_Token('TEXT', 'before calling the send_email ');
2007: fnd_msg_pub.Add;
2008: END IF;
2009:
2002: l_opp_amt_curncy := l_opp_amt ||' '||l_currency_code;
2003:
2004: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2005: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2006: fnd_message.Set_Token('TEXT', 'before calling the send_email ');
2007: fnd_msg_pub.Add;
2008: END IF;
2009:
2010: Send_Email_By_Workflow (
2060: p_data => x_msg_data);
2061:
2062: WHEN OTHERS THEN
2063: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2064: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2065: fnd_message.Set_Token('TEXT', sqlcode||sqlerrm);
2066: fnd_msg_pub.Add;
2067: END IF;
2068:
2061:
2062: WHEN OTHERS THEN
2063: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2064: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2065: fnd_message.Set_Token('TEXT', sqlcode||sqlerrm);
2066: fnd_msg_pub.Add;
2067: END IF;
2068:
2069: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2284: fnd_msg_pub.initialize;
2285: END IF;
2286:
2287: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2288: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2289: fnd_message.Set_Token('TEXT', 'In ' || l_api_name||' Lead ID : '||p_oppty_header_rec.lead_id
2290: ||' Salesforce ID : '||p_salesforce_id);
2291: fnd_msg_pub.Add;
2292: END IF;
2285: END IF;
2286:
2287: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2288: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2289: fnd_message.Set_Token('TEXT', 'In ' || l_api_name||' Lead ID : '||p_oppty_header_rec.lead_id
2290: ||' Salesforce ID : '||p_salesforce_id);
2291: fnd_msg_pub.Add;
2292: END IF;
2293:
2425: fnd_msg_pub.initialize;
2426: END IF;
2427:
2428: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2429: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2430: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
2431: fnd_msg_pub.Add;
2432: END IF;
2433:
2426: END IF;
2427:
2428: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2429: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2430: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
2431: fnd_msg_pub.Add;
2432: END IF;
2433:
2434: -- Initialize API return status to success
2500: p_count => x_msg_count,
2501: p_data => x_msg_data);
2502:
2503: WHEN no_data_found THEN
2504: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2505: fnd_message.Set_Token('TEXT', 'Current resource does not have a login user assigned. '||
2506: 'Please use resource manager to assign a login user to this resource ');
2507: fnd_msg_pub.Add;
2508:
2501: p_data => x_msg_data);
2502:
2503: WHEN no_data_found THEN
2504: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2505: fnd_message.Set_Token('TEXT', 'Current resource does not have a login user assigned. '||
2506: 'Please use resource manager to assign a login user to this resource ');
2507: fnd_msg_pub.Add;
2508:
2509: x_return_status := FND_API.G_RET_STS_ERROR ;
2652: fetch lc_chk_channel_code into l_channel_flag;
2653: close lc_chk_channel_code;
2654:
2655: if (l_channel_flag = null or l_channel_flag = 'N') then
2656: fnd_message.SET_NAME('PV', 'PV_INVALID_CHANNEL_CODE');
2657: fnd_msg_pub.ADD;
2658: raise FND_API.G_EXC_ERROR;
2659: end if;
2660:
2675: p_count => x_msg_count,
2676: p_data => x_msg_data);
2677:
2678: WHEN no_data_found THEN
2679: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2680: fnd_message.Set_Token('TEXT', 'Current resource does not have a login user assigned. '||
2681: 'Please use resource manager to assign a login user to this resource ');
2682: fnd_msg_pub.Add;
2683:
2676: p_data => x_msg_data);
2677:
2678: WHEN no_data_found THEN
2679: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2680: fnd_message.Set_Token('TEXT', 'Current resource does not have a login user assigned. '||
2681: 'Please use resource manager to assign a login user to this resource ');
2682: fnd_msg_pub.Add;
2683:
2684: x_return_status := FND_API.G_RET_STS_ERROR ;
2702: )
2703: IS
2704:
2705: BEGIN
2706: FND_MESSAGE.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2707: FND_MESSAGE.Set_Token('TEXT', p_msg_string);
2708: FND_MSG_PUB.Add;
2709:
2710: END Debug;
2703: IS
2704:
2705: BEGIN
2706: FND_MESSAGE.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2707: FND_MESSAGE.Set_Token('TEXT', p_msg_string);
2708: FND_MSG_PUB.Add;
2709:
2710: END Debug;
2711: