94: END IF;
95:
96: -- Debug Message
97: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
98: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
99: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
100: fnd_msg_pub.Add;
101: END IF;
102:
95:
96: -- Debug Message
97: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
98: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
99: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
100: fnd_msg_pub.Add;
101: END IF;
102:
103: -- Initialize API return status to SUCCESS
228: END IF;
229:
230: -- Debug Message
231: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
232: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
233: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
234: fnd_msg_pub.Add;
235: END IF;
236:
229:
230: -- Debug Message
231: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
232: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
233: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
234: fnd_msg_pub.Add;
235: END IF;
236:
237: -- Initialize API return status to SUCCESS
387: END IF;
388:
389: -- Debug Message
390: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
391: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
392: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
393: fnd_msg_pub.Add;
394: END IF;
395:
388:
389: -- Debug Message
390: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
391: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
392: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
393: fnd_msg_pub.Add;
394: END IF;
395:
396: x_return_status := FND_API.G_RET_STS_SUCCESS ;
407: returning lead_assignment_id, resource_id
408: into l_lead_assignment_id, l_party_resource_id;
409:
410: IF (SQL%NOTFOUND) THEN
411: fnd_message.SET_NAME('PV', 'Cannot find row to update');
412: fnd_msg_pub.ADD;
413:
414: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
415: END IF;
416:
417: if (l_lead_assignment_id <> p_lead_assignment_id or
418: l_party_resource_id <> p_party_resource_id )
419: then
420: fnd_message.SET_NAME('PV', 'Updated wrong row');
421: fnd_msg_pub.ADD;
422:
423: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
424: end if;
543: END IF;
544:
545: -- Debug Message
546: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
547: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
548: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
549: fnd_msg_pub.Add;
550: END IF;
551:
544:
545: -- Debug Message
546: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
547: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
548: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
549: fnd_msg_pub.Add;
550: END IF;
551:
552: x_return_status := FND_API.G_RET_STS_SUCCESS ;
556: itemkey => p_itemkey,
557: aname => pv_workflow_pub.g_wf_attr_partner_id), 0);
558:
559: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
560: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
561: fnd_message.Set_Token('TEXT', 'Get notify id for partner_id: ' || l_partner_id);
562: fnd_msg_pub.Add;
563: END IF;
564:
557: aname => pv_workflow_pub.g_wf_attr_partner_id), 0);
558:
559: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
560: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
561: fnd_message.Set_Token('TEXT', 'Get notify id for partner_id: ' || l_partner_id);
562: fnd_msg_pub.Add;
563: END IF;
564:
565: open lc_get_notified (pc_itemtype => p_itemtype,
779:
780: -- Debug Message
781: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
782:
783: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
784: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. ID: ' || p_lead_assignment_id || ' Action: ' || p_action);
785: fnd_msg_pub.Add;
786:
787: if p_action = pv_assignment_pub.g_asgn_action_status_update then
780: -- Debug Message
781: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
782:
783: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
784: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. ID: ' || p_lead_assignment_id || ' Action: ' || p_action);
785: fnd_msg_pub.Add;
786:
787: if p_action = pv_assignment_pub.g_asgn_action_status_update then
788:
785: fnd_msg_pub.Add;
786:
787: if p_action = pv_assignment_pub.g_asgn_action_status_update then
788:
789: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
790: fnd_message.Set_Name('PV', 'Status: ' || p_status);
791: fnd_msg_pub.Add;
792:
793: end if;
786:
787: if p_action = pv_assignment_pub.g_asgn_action_status_update then
788:
789: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
790: fnd_message.Set_Name('PV', 'Status: ' || p_status);
791: fnd_msg_pub.Add;
792:
793: end if;
794:
801: if p_action is NULL or
802: p_action not in (pv_assignment_pub.g_asgn_action_status_update,
803: pv_assignment_pub.g_asgn_action_move_to_log) then
804:
805: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
806: fnd_message.SET_TOKEN('TEXT', 'Invalid action mode:' || nvl(p_action, 'NULL') );
807: fnd_msg_pub.ADD;
808:
809: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
802: p_action not in (pv_assignment_pub.g_asgn_action_status_update,
803: pv_assignment_pub.g_asgn_action_move_to_log) then
804:
805: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
806: fnd_message.SET_TOKEN('TEXT', 'Invalid action mode:' || nvl(p_action, 'NULL') );
807: fnd_msg_pub.ADD;
808:
809: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
810:
832: l_bypass_cm_flag;
833: CLOSE lc_get_assign_row;
834:
835: IF (l_rowid is NULL) THEN
836: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
837: fnd_message.SET_TOKEN('TEXT', 'Cannot find row');
838: fnd_msg_pub.ADD;
839:
840: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
833: CLOSE lc_get_assign_row;
834:
835: IF (l_rowid is NULL) THEN
836: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
837: fnd_message.SET_TOKEN('TEXT', 'Cannot find row');
838: fnd_msg_pub.ADD;
839:
840: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
841: END IF;
890: last_update_login = FND_GLOBAL.login_id
891: where rowid = l_rowid;
892:
893: IF (SQL%NOTFOUND) THEN
894: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
895: fnd_message.SET_TOKEN('TEXT', 'Cannot find row to update');
896: fnd_msg_pub.ADD;
897:
898: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
891: where rowid = l_rowid;
892:
893: IF (SQL%NOTFOUND) THEN
894: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
895: fnd_message.SET_TOKEN('TEXT', 'Cannot find row to update');
896: fnd_msg_pub.ADD;
897:
898: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
899: END IF;
915: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
916: raise FND_API.G_EXC_ERROR;
917: end if;
918: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
919: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
920: fnd_message.Set_Token('TEXT', 'START:Logging in Opportunity Routing Log ');
921: fnd_msg_pub.Add;
922: END IF;
923:
916: raise FND_API.G_EXC_ERROR;
917: end if;
918: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
919: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
920: fnd_message.Set_Token('TEXT', 'START:Logging in Opportunity Routing Log ');
921: fnd_msg_pub.Add;
922: END IF;
923:
924: -- vansub
951: ELSIF p_status = pv_assignment_pub.g_la_status_lost_chance THEN
952: l_oppty_routing_log_rec.event := 'OPPTY_TAKEN';
953: END IF;
954: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
955: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
956: fnd_message.Set_Token('TEXT', 'Status : '||p_status||' Event : '||l_oppty_routing_log_rec.event);
957: fnd_msg_pub.Add;
958: END IF;
959: l_oppty_routing_log_rec.lead_id := l_lead_id;
952: l_oppty_routing_log_rec.event := 'OPPTY_TAKEN';
953: END IF;
954: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
955: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
956: fnd_message.Set_Token('TEXT', 'Status : '||p_status||' Event : '||l_oppty_routing_log_rec.event);
957: fnd_msg_pub.Add;
958: END IF;
959: l_oppty_routing_log_rec.lead_id := l_lead_id;
960: l_oppty_routing_log_rec.lead_workflow_id := l_lead_workflow_id;
977: l_oppty_routing_log_rec.vendor_user_id := NULL;
978: l_oppty_routing_log_rec.pt_contact_user_id := FND_GLOBAL.user_id;
979: END IF;
980: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
981: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
982: fnd_message.Set_Token('TEXT', 'Vendor User ID '||l_oppty_routing_log_rec.vendor_user_id);
983: fnd_msg_pub.Add;
984: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
985: fnd_message.Set_Token('TEXT', 'Partner User ID '||l_oppty_routing_log_rec.pt_contact_user_id);
978: l_oppty_routing_log_rec.pt_contact_user_id := FND_GLOBAL.user_id;
979: END IF;
980: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
981: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
982: fnd_message.Set_Token('TEXT', 'Vendor User ID '||l_oppty_routing_log_rec.vendor_user_id);
983: fnd_msg_pub.Add;
984: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
985: fnd_message.Set_Token('TEXT', 'Partner User ID '||l_oppty_routing_log_rec.pt_contact_user_id);
986: fnd_msg_pub.Add;
980: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
981: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
982: fnd_message.Set_Token('TEXT', 'Vendor User ID '||l_oppty_routing_log_rec.vendor_user_id);
983: fnd_msg_pub.Add;
984: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
985: fnd_message.Set_Token('TEXT', 'Partner User ID '||l_oppty_routing_log_rec.pt_contact_user_id);
986: fnd_msg_pub.Add;
987: END IF;-- Setting Vendor and Partner User ID to SYSTEM and user type also to SYSTEM
988: IF p_status IN ( pv_assignment_pub.g_la_status_cm_timeout
981: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
982: fnd_message.Set_Token('TEXT', 'Vendor User ID '||l_oppty_routing_log_rec.vendor_user_id);
983: fnd_msg_pub.Add;
984: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
985: fnd_message.Set_Token('TEXT', 'Partner User ID '||l_oppty_routing_log_rec.pt_contact_user_id);
986: fnd_msg_pub.Add;
987: END IF;-- Setting Vendor and Partner User ID to SYSTEM and user type also to SYSTEM
988: IF p_status IN ( pv_assignment_pub.g_la_status_cm_timeout
989: , pv_assignment_pub.g_la_status_pt_timeout
1055:
1056: delete from pv_lead_assignments where rowid = l_rowid;
1057:
1058: IF (SQL%ROWCOUNT = 0) THEN
1059: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
1060: fnd_message.SET_TOKEN('TEXT', 'Cannot find row to delete');
1061: fnd_msg_pub.ADD;
1062:
1063: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1056: delete from pv_lead_assignments where rowid = l_rowid;
1057:
1058: IF (SQL%ROWCOUNT = 0) THEN
1059: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
1060: fnd_message.SET_TOKEN('TEXT', 'Cannot find row to delete');
1061: fnd_msg_pub.ADD;
1062:
1063: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1064: END IF;
1389: END IF;
1390:
1391: -- Debug Message
1392: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1393: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1394: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. itemkey = ' || p_itemkey);
1395: fnd_msg_pub.Add;
1396: END IF;
1397:
1390:
1391: -- Debug Message
1392: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1393: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1394: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. itemkey = ' || p_itemkey);
1395: fnd_msg_pub.Add;
1396: END IF;
1397:
1398: x_return_status := FND_API.G_RET_STS_SUCCESS ;
1439: END IF;
1440:
1441: -- Debug Message
1442: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1443: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1444: fnd_message.Set_Token('TEXT', 'Removing ' || l_party || ' from accesses');
1445: fnd_msg_pub.Add;
1446: END IF;
1447:
1440:
1441: -- Debug Message
1442: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1443: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1444: fnd_message.Set_Token('TEXT', 'Removing ' || l_party || ' from accesses');
1445: fnd_msg_pub.Add;
1446: END IF;
1447:
1448: if l_party = 'PARTNER' then
1483: EXIT WHEN lc_get_reject_accesses_pt%NOTFOUND;
1484:
1485: -- Debug Message
1486: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1487: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1488: fnd_message.Set_Token('TEXT', 'Removing ' || l_party || ' from accesses');
1489: fnd_msg_pub.Add;
1490: END IF;
1491:
1484:
1485: -- Debug Message
1486: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1487: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1488: fnd_message.Set_Token('TEXT', 'Removing ' || l_party || ' from accesses');
1489: fnd_msg_pub.Add;
1490: END IF;
1491:
1492: pv_assign_util_pvt.UpdateAccess(
1633: END IF;
1634:
1635: -- Debug Message
1636: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1637: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1638: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. itemkey: ' || p_itemkey || '. Type: ' || p_timeouttype);
1639: fnd_msg_pub.Add;
1640: END IF;
1641:
1634:
1635: -- Debug Message
1636: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1637: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1638: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. itemkey: ' || p_itemkey || '. Type: ' || p_timeouttype);
1639: fnd_msg_pub.Add;
1640: END IF;
1641:
1642: x_return_status := FND_API.G_RET_STS_SUCCESS ;
1651: l_timeout_profile := 'PV_DEFAULT_PT_TIMEOUT';
1652:
1653: else
1654:
1655: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1656: fnd_message.set_token('TEXT', 'Invalid timeout type: ' || p_timeoutType);
1657: fnd_msg_pub.Add;
1658:
1659: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1652:
1653: else
1654:
1655: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1656: fnd_message.set_token('TEXT', 'Invalid timeout type: ' || p_timeoutType);
1657: fnd_msg_pub.Add;
1658:
1659: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1660:
1670: aname => pv_workflow_pub.g_wf_attr_process_rule_id);
1671:
1672:
1673: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1674: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1675: fnd_message.Set_Token('TEXT', 'Process Rule ID from set timeout '||l_process_rule_id);
1676: fnd_msg_pub.Add;
1677: END IF;
1678:
1671:
1672:
1673: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1674: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1675: fnd_message.Set_Token('TEXT', 'Process Rule ID from set timeout '||l_process_rule_id);
1676: fnd_msg_pub.Add;
1677: END IF;
1678:
1679:
1686: from fnd_timezones_vl
1687: where timezone_code = 'GMT';
1688:
1689: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1690: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1691: fnd_message.Set_Token('TEXT', 'GMT Timezone ID '|| l_GMT_timezone_id);
1692: fnd_msg_pub.Add;
1693: END IF;
1694:
1687: where timezone_code = 'GMT';
1688:
1689: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1690: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1691: fnd_message.Set_Token('TEXT', 'GMT Timezone ID '|| l_GMT_timezone_id);
1692: fnd_msg_pub.Add;
1693: END IF;
1694:
1695: -- -----------------------------------------------------------------------
1747: open lc_get_rule_timeout(p_timeoutType, l_process_rule_id);
1748: fetch lc_get_rule_timeout into l_rule_timeout;
1749:
1750: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1751: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1752: fnd_message.Set_Token('TEXT', 'Timeout type is '||p_timeoutType||'Rule timeout is '|| l_rule_timeout);
1753: fnd_msg_pub.Add;
1754: END IF;
1755:
1748: fetch lc_get_rule_timeout into l_rule_timeout;
1749:
1750: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1751: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1752: fnd_message.Set_Token('TEXT', 'Timeout type is '||p_timeoutType||'Rule timeout is '|| l_rule_timeout);
1753: fnd_msg_pub.Add;
1754: END IF;
1755:
1756: IF lc_get_rule_timeout%FOUND and l_rule_timeout is not null THEN
1779: fetch lc_get_rule_timeout into l_rule_timeout;
1780:
1781:
1782: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1783: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1784: fnd_message.Set_Token('TEXT', 'Rule timeout is from auto matching rule '|| l_rule_timeout);
1785: fnd_msg_pub.Add;
1786: END IF;
1787:
1780:
1781:
1782: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1783: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1784: fnd_message.Set_Token('TEXT', 'Rule timeout is from auto matching rule '|| l_rule_timeout);
1785: fnd_msg_pub.Add;
1786: END IF;
1787:
1788: IF lc_get_rule_timeout%FOUND and l_rule_timeout is not null THEN
1871: l_GMT_time := to_char(l_GMT_date,'DD-MON-YYYY HH24:MI')||' '||'GMT';
1872:
1873:
1874: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1875: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1876: fnd_message.Set_Token('TEXT', 'GMT timeout is '|| l_GMT_time);
1877: fnd_msg_pub.Add;
1878: END IF;
1879:
1872:
1873:
1874: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1875: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1876: fnd_message.Set_Token('TEXT', 'GMT timeout is '|| l_GMT_time);
1877: fnd_msg_pub.Add;
1878: END IF;
1879:
1880:
1916: END IF;
1917:
1918: -- Debug Message
1919: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1920: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1921: fnd_message.Set_token('TEXT', 'Timeout set to: ' || l_timeout);
1922: fnd_msg_pub.Add;
1923: END IF;
1924:
1917:
1918: -- Debug Message
1919: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1920: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1921: fnd_message.Set_token('TEXT', 'Timeout set to: ' || l_timeout);
1922: fnd_msg_pub.Add;
1923: END IF;
1924:
1925: IF FND_API.To_Boolean ( p_commit ) THEN
1994: END IF;
1995:
1996: -- Debug Message
1997: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1998: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1999: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Itemkey: ' || p_itemkey || '. Partner id: ' || p_partner_id);
2000: fnd_msg_pub.Add;
2001: END IF;
2002:
1995:
1996: -- Debug Message
1997: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1998: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1999: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Itemkey: ' || p_itemkey || '. Partner id: ' || p_partner_id);
2000: fnd_msg_pub.Add;
2001: END IF;
2002:
2003: x_return_status := FND_API.G_RET_STS_SUCCESS ;
2159: END IF;
2160:
2161: -- Debug Message
2162: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2163: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2164: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
2165: fnd_msg_pub.Add;
2166: END IF;
2167:
2160:
2161: -- Debug Message
2162: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2163: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2164: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
2165: fnd_msg_pub.Add;
2166: END IF;
2167:
2168: x_return_status := FND_API.G_RET_STS_SUCCESS ;
2185: fetch lc_get_pt_org_name into l_partner_org;
2186:
2187: if lc_get_pt_org_name%notfound then
2188:
2189: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2190: fnd_message.Set_token('TEXT', 'Cannot find partner for itemkey: ' || p_itemkey || '. Partner id: ' || p_partner_id);
2191: fnd_msg_pub.Add;
2192: raise FND_API.G_EXC_ERROR;
2193:
2186:
2187: if lc_get_pt_org_name%notfound then
2188:
2189: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2190: fnd_message.Set_token('TEXT', 'Cannot find partner for itemkey: ' || p_itemkey || '. Partner id: ' || p_partner_id);
2191: fnd_msg_pub.Add;
2192: raise FND_API.G_EXC_ERROR;
2193:
2194: end if;
2300: raise FND_API.G_EXC_ERROR;
2301: end if;
2302:
2303: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2304: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2305: fnd_message.Set_Token('TEXT', 'Updating opportunity last offered date for partner ' || nvl(to_char(p_partner_id), '(s)'));
2306: fnd_msg_pub.Add;
2307: END IF;
2308:
2301: end if;
2302:
2303: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2304: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2305: fnd_message.Set_Token('TEXT', 'Updating opportunity last offered date for partner ' || nvl(to_char(p_partner_id), '(s)'));
2306: fnd_msg_pub.Add;
2307: END IF;
2308:
2309: if p_partner_id is not null then
2338: ));
2339: end if;
2340:
2341: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2342: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2343: fnd_message.Set_Token('TEXT', 'Setting access code for partner ' || nvl(to_char(p_partner_id), '(s)'));
2344: fnd_msg_pub.Add;
2345: END IF;
2346:
2339: end if;
2340:
2341: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2342: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2343: fnd_message.Set_Token('TEXT', 'Setting access code for partner ' || nvl(to_char(p_partner_id), '(s)'));
2344: fnd_msg_pub.Add;
2345: END IF;
2346:
2347: if p_partner_id is not null then
2513: END IF;
2514:
2515: -- Debug Message
2516: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2517: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2518: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
2519: fnd_msg_pub.Add;
2520: END IF;
2521:
2514:
2515: -- Debug Message
2516: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2517: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2518: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
2519: fnd_msg_pub.Add;
2520: END IF;
2521:
2522: x_return_status := FND_API.G_RET_STS_SUCCESS ;
2528: pv_assignment_pub.g_r_status_abandoned,
2529: pv_assignment_pub.g_r_status_unassigned,
2530: pv_assignment_pub.g_r_status_withdrawn) then
2531:
2532: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2533: fnd_message.SET_TOKEN('TEXT', 'Invalid workflow routing stage. Itemkey: ' || p_itemkey ||
2534: '. Stage: ' || p_routing_stage);
2535: fnd_msg_pub.ADD;
2536:
2529: pv_assignment_pub.g_r_status_unassigned,
2530: pv_assignment_pub.g_r_status_withdrawn) then
2531:
2532: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2533: fnd_message.SET_TOKEN('TEXT', 'Invalid workflow routing stage. Itemkey: ' || p_itemkey ||
2534: '. Stage: ' || p_routing_stage);
2535: fnd_msg_pub.ADD;
2536:
2537: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2545: close lc_get_workflow;
2546:
2547:
2548: if l_rowid is null then
2549: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2550: fnd_message.SET_TOKEN('TEXT', 'Cannot find workflow row to update. Itemkey: ' || p_itemkey);
2551: fnd_msg_pub.ADD;
2552: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2553: end if;
2546:
2547:
2548: if l_rowid is null then
2549: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2550: fnd_message.SET_TOKEN('TEXT', 'Cannot find workflow row to update. Itemkey: ' || p_itemkey);
2551: fnd_msg_pub.ADD;
2552: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2553: end if;
2554:
2824: END IF;
2825:
2826: -- Debug Message
2827: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2828: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2829: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Itemtype: ' || p_itemtype || '. Itemkey: ' || p_itemkey);
2830: fnd_msg_pub.Add;
2831: END IF;
2832:
2825:
2826: -- Debug Message
2827: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2828: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2829: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Itemtype: ' || p_itemtype || '. Itemkey: ' || p_itemkey);
2830: fnd_msg_pub.Add;
2831: END IF;
2832:
2833: -- Initialize API return status to success
2885: itemkey => p_itemKey,
2886: aname => 'PV_PT_RESPOND_URL_ATTR',
2887: avalue => l_pt_respond_URL);
2888: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2889: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2890: fnd_message.Set_Token('TEXT', 'process rule id in the if of workflow set'|| p_attrib_values_rec.process_rule_id);
2891: fnd_msg_pub.Add;
2892: END IF;
2893:
2886: aname => 'PV_PT_RESPOND_URL_ATTR',
2887: avalue => l_pt_respond_URL);
2888: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2889: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2890: fnd_message.Set_Token('TEXT', 'process rule id in the if of workflow set'|| p_attrib_values_rec.process_rule_id);
2891: fnd_msg_pub.Add;
2892: END IF;
2893:
2894: -- Setting Process Rule ID Attribute
2915: aname => pv_workflow_pub.g_wf_attr_entity_name,
2916: avalue => p_attrib_values_rec.entity_name);
2917:
2918: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2919: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2920: fnd_message.Set_Token('TEXT', 'in startworkflow Entity Amount'||p_attrib_values_rec.entity_amount);
2921: fnd_msg_pub.Add;
2922: END IF;
2923: wf_engine.SetItemAttrText( itemtype => p_itemtype,
2916: avalue => p_attrib_values_rec.entity_name);
2917:
2918: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2919: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2920: fnd_message.Set_Token('TEXT', 'in startworkflow Entity Amount'||p_attrib_values_rec.entity_amount);
2921: fnd_msg_pub.Add;
2922: END IF;
2923: wf_engine.SetItemAttrText( itemtype => p_itemtype,
2924: itemkey => p_itemkey,
2926: avalue => p_attrib_values_rec.entity_amount);
2927:
2928:
2929: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2930: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2931: fnd_message.Set_Token('TEXT', 'after the entity amount');
2932: fnd_msg_pub.Add;
2933: END IF;
2934:
2927:
2928:
2929: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2930: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2931: fnd_message.Set_Token('TEXT', 'after the entity amount');
2932: fnd_msg_pub.Add;
2933: END IF;
2934:
2935: wf_engine.SetItemAttrText ( itemtype => p_itemtype,
3040: END IF;
3041:
3042: -- Debug Message
3043: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3044: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3045: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
3046: fnd_msg_pub.Add;
3047: END IF;
3048:
3041:
3042: -- Debug Message
3043: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3044: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3045: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
3046: fnd_msg_pub.Add;
3047: END IF;
3048:
3049: x_return_status := FND_API.G_RET_STS_SUCCESS ;
3049: x_return_status := FND_API.G_RET_STS_SUCCESS ;
3050:
3051: if p_response_code is null then
3052:
3053: fnd_message.SET_NAME('PV', 'PV_INVALID_RESPONSE');
3054: fnd_message.SET_TOKEN('STATUS', p_response_code);
3055: fnd_msg_pub.ADD;
3056:
3057: raise FND_API.G_EXC_ERROR;
3050:
3051: if p_response_code is null then
3052:
3053: fnd_message.SET_NAME('PV', 'PV_INVALID_RESPONSE');
3054: fnd_message.SET_TOKEN('STATUS', p_response_code);
3055: fnd_msg_pub.ADD;
3056:
3057: raise FND_API.G_EXC_ERROR;
3058:
3059: end if;
3060:
3061: if p_decision_maker_flag <> 'Y' or p_decision_maker_flag is NULL then
3062:
3063: fnd_message.set_name('PV', 'PV_NOT_DECISION_MAKER');
3064: fnd_msg_pub.ADD;
3065:
3066: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3067:
3074: close lc_code_meaning;
3075:
3076: if l_response_txt is null then
3077:
3078: fnd_message.SET_NAME('PV', 'PV_INVALID_RESPONSE');
3079: fnd_message.SET_TOKEN('STATUS', p_response_code);
3080: fnd_msg_pub.ADD;
3081:
3082: raise FND_API.G_EXC_ERROR;
3075:
3076: if l_response_txt is null then
3077:
3078: fnd_message.SET_NAME('PV', 'PV_INVALID_RESPONSE');
3079: fnd_message.SET_TOKEN('STATUS', p_response_code);
3080: fnd_msg_pub.ADD;
3081:
3082: raise FND_API.G_EXC_ERROR;
3083: end if;
3120:
3121: fetch lc_code_meaning into l_routing_status_txt;
3122: close lc_code_meaning;
3123:
3124: fnd_message.SET_NAME('PV', 'PV_INVALID_LEAD_RESPONSE');
3125: fnd_message.SET_TOKEN('P_RESPONSE', l_response_txt);
3126: fnd_message.SET_TOKEN('P_LEAD_STATUS', l_routing_status_txt);
3127: fnd_msg_pub.ADD;
3128:
3121: fetch lc_code_meaning into l_routing_status_txt;
3122: close lc_code_meaning;
3123:
3124: fnd_message.SET_NAME('PV', 'PV_INVALID_LEAD_RESPONSE');
3125: fnd_message.SET_TOKEN('P_RESPONSE', l_response_txt);
3126: fnd_message.SET_TOKEN('P_LEAD_STATUS', l_routing_status_txt);
3127: fnd_msg_pub.ADD;
3128:
3129: raise FND_API.G_EXC_ERROR;
3122: close lc_code_meaning;
3123:
3124: fnd_message.SET_NAME('PV', 'PV_INVALID_LEAD_RESPONSE');
3125: fnd_message.SET_TOKEN('P_RESPONSE', l_response_txt);
3126: fnd_message.SET_TOKEN('P_LEAD_STATUS', l_routing_status_txt);
3127: fnd_msg_pub.ADD;
3128:
3129: raise FND_API.G_EXC_ERROR;
3130: end if;
3197: END IF;
3198:
3199: -- Debug Message
3200: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3201: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3202: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
3203: fnd_msg_pub.Add;
3204: END IF;
3205:
3198:
3199: -- Debug Message
3200: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3201: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3202: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
3203: fnd_msg_pub.Add;
3204: END IF;
3205:
3206: x_return_status := FND_API.G_RET_STS_SUCCESS ;
3286: END IF;
3287:
3288: -- Debug Message
3289: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3290: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3291: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
3292: fnd_msg_pub.Add;
3293: END IF;
3294:
3287:
3288: -- Debug Message
3289: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3290: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3291: fnd_message.Set_Token('TEXT', 'In ' || l_api_name);
3292: fnd_msg_pub.Add;
3293: END IF;
3294:
3295: -- Initialize API return status to SUCCESS
3299: -- API body
3300: --
3301:
3302: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3303: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3304: fnd_message.Set_Token('TEXT', 'Bulk adding ' || p_party_Notify_rec_tbl.lead_assignment_id.count || ' rows');
3305: fnd_msg_pub.Add;
3306: END IF;
3307:
3300: --
3301:
3302: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3303: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3304: fnd_message.Set_Token('TEXT', 'Bulk adding ' || p_party_Notify_rec_tbl.lead_assignment_id.count || ' rows');
3305: fnd_msg_pub.Add;
3306: END IF;
3307:
3308: if p_party_Notify_rec_tbl.lead_assignment_id.count > 0 then
3585: END IF;
3586:
3587: -- Debug Message
3588: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3589: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3590: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. itemkey = ' || p_itemkey);
3591: fnd_msg_pub.Add;
3592: END IF;
3593:
3586:
3587: -- Debug Message
3588: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3589: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3590: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. itemkey = ' || p_itemkey);
3591: fnd_msg_pub.Add;
3592: END IF;
3593:
3594: x_return_status := FND_API.G_RET_STS_SUCCESS ;
3617: close lc_get_notify_flags;
3618:
3619: if l_notify_enabled_flag is NULL then
3620:
3621: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
3622: fnd_message.SET_TOKEN('TEXT', 'Cannot find routing stage: ' || p_route_stage || ' in pv_status_notifications');
3623: fnd_msg_pub.ADD;
3624: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3625:
3618:
3619: if l_notify_enabled_flag is NULL then
3620:
3621: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
3622: fnd_message.SET_TOKEN('TEXT', 'Cannot find routing stage: ' || p_route_stage || ' in pv_status_notifications');
3623: fnd_msg_pub.ADD;
3624: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3625:
3626: end if;
3625:
3626: end if;
3627:
3628: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3629: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3630: fnd_message.Set_Token('TEXT', 'Lead id: ' || l_lead_id ||
3631: '. Notification for routing: ' || p_route_stage ||
3632: '. Enabled: ' || l_notify_enabled_flag);
3633: fnd_msg_pub.Add;
3626: end if;
3627:
3628: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3629: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3630: fnd_message.Set_Token('TEXT', 'Lead id: ' || l_lead_id ||
3631: '. Notification for routing: ' || p_route_stage ||
3632: '. Enabled: ' || l_notify_enabled_flag);
3633: fnd_msg_pub.Add;
3634: END IF;
3635:
3636: if l_notify_enabled_flag = 'Y' then
3637:
3638: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3639: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3640: fnd_message.Set_Token('TEXT', ' Notify AM: ' || l_notify_am_flag ||
3641: ' Notify PT: ' || l_notify_pt_flag ||
3642: ' Notify CM: ' || l_notify_cm_flag ||
3643: ' Notify other: ' || l_notify_ot_flag);
3636: if l_notify_enabled_flag = 'Y' then
3637:
3638: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3639: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3640: fnd_message.Set_Token('TEXT', ' Notify AM: ' || l_notify_am_flag ||
3641: ' Notify PT: ' || l_notify_pt_flag ||
3642: ' Notify CM: ' || l_notify_cm_flag ||
3643: ' Notify other: ' || l_notify_ot_flag);
3644: fnd_msg_pub.Add;
3737: l_profile_flag := nvl(fnd_profile.value_specific(name => 'PV_' || p_route_stage || '_NOTIFY_FLAG',
3738: user_id => l_user_id), 'Y');
3739:
3740: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3741: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3742: fnd_message.Set_Token('TEXT', 'User: ' || l_username || '. Usertype: ' || l_usertype ||
3743: '. Profile notify flag: ' || l_profile_flag || '. partner id: ' || l_partner_id);
3744: fnd_msg_pub.Add;
3745: end if;
3738: user_id => l_user_id), 'Y');
3739:
3740: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3741: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3742: fnd_message.Set_Token('TEXT', 'User: ' || l_username || '. Usertype: ' || l_usertype ||
3743: '. Profile notify flag: ' || l_profile_flag || '. partner id: ' || l_partner_id);
3744: fnd_msg_pub.Add;
3745: end if;
3746:
3926:
3927: if l_msg_name is not null then
3928:
3929: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3930: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3931: fnd_message.Set_token('TEXT', 'Creating role: '||l_adhoc_role||' with members--- ');
3932: fnd_msg_pub.Add;
3933: END IF;
3934:
3927: if l_msg_name is not null then
3928:
3929: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3930: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3931: fnd_message.Set_token('TEXT', 'Creating role: '||l_adhoc_role||' with members--- ');
3932: fnd_msg_pub.Add;
3933: END IF;
3934:
3935: FOR ind in 1 .. l_role_list.count
3949: role_users => l_role_list);
3950: EXCEPTION
3951: WHEN OTHERS THEN
3952: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3953: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3954: fnd_message.Set_token('TEXT', 'Did not create the role as it already exists');
3955: fnd_msg_pub.Add;
3956: END IF;
3957: EXIT;
3950: EXCEPTION
3951: WHEN OTHERS THEN
3952: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3953: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3954: fnd_message.Set_token('TEXT', 'Did not create the role as it already exists');
3955: fnd_msg_pub.Add;
3956: END IF;
3957: EXIT;
3958: END;
3966: close lc_get_pt_org_name;
3967:
3968: if l_partner_org is null then
3969:
3970: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3971: fnd_message.Set_token('TEXT', 'Cannot find partner id: ' || l_partner_id);
3972: fnd_msg_pub.Add;
3973: raise FND_API.G_EXC_ERROR;
3974:
3967:
3968: if l_partner_org is null then
3969:
3970: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3971: fnd_message.Set_token('TEXT', 'Cannot find partner id: ' || l_partner_id);
3972: fnd_msg_pub.Add;
3973: raise FND_API.G_EXC_ERROR;
3974:
3975: end if;
4031: send_comment => NULL,
4032: priority => NULL );
4033:
4034: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
4035: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4036: fnd_message.Set_Token('TEXT', 'Sent notification to role: ' || l_adhoc_role ||
4037: ' using message: ' || l_msg_name || '. Notify id: ' || l_group_notify_id );
4038: fnd_msg_pub.Add;
4039: end if;
4032: priority => NULL );
4033:
4034: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
4035: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4036: fnd_message.Set_Token('TEXT', 'Sent notification to role: ' || l_adhoc_role ||
4037: ' using message: ' || l_msg_name || '. Notify id: ' || l_group_notify_id );
4038: fnd_msg_pub.Add;
4039: end if;
4040:
4073:
4074: else
4075:
4076: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
4077: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4078: fnd_message.Set_Token('TEXT', 'Email is diabled at site level');
4079: fnd_msg_pub.Add;
4080: end if;
4081:
4074: else
4075:
4076: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
4077: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4078: fnd_message.Set_Token('TEXT', 'Email is diabled at site level');
4079: fnd_msg_pub.Add;
4080: end if;
4081:
4082: end if; --l_email_enabled_flag
4107:
4108: WHEN OTHERS THEN
4109: IF sqlcode = -20002 THEN
4110:
4111: fnd_message.Set_Name('PV', 'PV_WF_COMP_ACTY_ERR');
4112: fnd_msg_pub.Add;
4113:
4114: ELSE
4115:
4167: END IF;
4168:
4169: -- Debug Message
4170: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
4171: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4172: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Itemtype: ' || l_itemtype);
4173: fnd_msg_pub.Add;
4174: END IF;
4175:
4168:
4169: -- Debug Message
4170: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
4171: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4172: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Itemtype: ' || l_itemtype);
4173: fnd_msg_pub.Add;
4174: END IF;
4175:
4176: -- Initialize API return status to success
4179: select pv_lead_workflows_s.nextval into l_itemkey from dual;
4180:
4181:
4182: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
4183: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4184: fnd_message.Set_Token('TEXT', 'Before Creating the workflow process with Itemtype: ' || l_itemtype);
4185: fnd_msg_pub.Add;
4186: END IF;
4187:
4180:
4181:
4182: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
4183: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4184: fnd_message.Set_Token('TEXT', 'Before Creating the workflow process with Itemtype: ' || l_itemtype);
4185: fnd_msg_pub.Add;
4186: END IF;
4187:
4188:
4320: )
4321: IS
4322:
4323: BEGIN
4324: FND_MESSAGE.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4325: FND_MESSAGE.Set_Token('TEXT', p_msg_string);
4326: FND_MSG_PUB.Add;
4327: END Debug;
4328: -- =================================End of Debug================================
4321: IS
4322:
4323: BEGIN
4324: FND_MESSAGE.Set_Name('PV', 'PV_DEBUG_MESSAGE');
4325: FND_MESSAGE.Set_Token('TEXT', p_msg_string);
4326: FND_MSG_PUB.Add;
4327: END Debug;
4328: -- =================================End of Debug================================
4329:
4355: )
4356: IS
4357: BEGIN
4358: IF FND_MSG_PUB.Check_Msg_Level(p_msg_level) THEN
4359: FND_MESSAGE.Set_Name('PV', p_msg_name);
4360: FND_MESSAGE.Set_Token(p_token1, p_token1_value);
4361:
4362: IF (p_token2 IS NOT NULL) THEN
4363: FND_MESSAGE.Set_Token(p_token2, p_token2_value);
4356: IS
4357: BEGIN
4358: IF FND_MSG_PUB.Check_Msg_Level(p_msg_level) THEN
4359: FND_MESSAGE.Set_Name('PV', p_msg_name);
4360: FND_MESSAGE.Set_Token(p_token1, p_token1_value);
4361:
4362: IF (p_token2 IS NOT NULL) THEN
4363: FND_MESSAGE.Set_Token(p_token2, p_token2_value);
4364: END IF;
4359: FND_MESSAGE.Set_Name('PV', p_msg_name);
4360: FND_MESSAGE.Set_Token(p_token1, p_token1_value);
4361:
4362: IF (p_token2 IS NOT NULL) THEN
4363: FND_MESSAGE.Set_Token(p_token2, p_token2_value);
4364: END IF;
4365:
4366: IF (p_token3 IS NOT NULL) THEN
4367: FND_MESSAGE.Set_Token(p_token3, p_token3_value);
4363: FND_MESSAGE.Set_Token(p_token2, p_token2_value);
4364: END IF;
4365:
4366: IF (p_token3 IS NOT NULL) THEN
4367: FND_MESSAGE.Set_Token(p_token3, p_token3_value);
4368: END IF;
4369:
4370: FND_MSG_PUB.Add;
4371: END IF;