96: RETURN wf_rolename ;
97:
98: exception
99: when no_data_found then
100: fnd_message.set_name('JTF', 'JTF_RS_ROLE_NOTFOUND');
101: fnd_message.set_token('P_RESOURCE_NAME', l_resource_name);
102: fnd_msg_pub.add;
103: return null ;
104: when too_many_rows then
97:
98: exception
99: when no_data_found then
100: fnd_message.set_name('JTF', 'JTF_RS_ROLE_NOTFOUND');
101: fnd_message.set_token('P_RESOURCE_NAME', l_resource_name);
102: fnd_msg_pub.add;
103: return null ;
104: when too_many_rows then
105: fnd_message.set_name('JTF', 'JTF_RS_MORE_WF_ROLES');
101: fnd_message.set_token('P_RESOURCE_NAME', l_resource_name);
102: fnd_msg_pub.add;
103: return null ;
104: when too_many_rows then
105: fnd_message.set_name('JTF', 'JTF_RS_MORE_WF_ROLES');
106: fnd_message.set_token('P_RESOURCE_NAME', l_resource_name);
107: fnd_msg_pub.add;
108: return null ;
109: when others then
102: fnd_msg_pub.add;
103: return null ;
104: when too_many_rows then
105: fnd_message.set_name('JTF', 'JTF_RS_MORE_WF_ROLES');
106: fnd_message.set_token('P_RESOURCE_NAME', l_resource_name);
107: fnd_msg_pub.add;
108: return null ;
109: when others then
110: fnd_message.set_name('JTF', 'JTF_RS_RESOURCE_GET_ROLE_ERR');
106: fnd_message.set_token('P_RESOURCE_NAME', l_resource_name);
107: fnd_msg_pub.add;
108: return null ;
109: when others then
110: fnd_message.set_name('JTF', 'JTF_RS_RESOURCE_GET_ROLE_ERR');
111: fnd_msg_pub.add;
112: return null ;
113: END;
114:
520: OR l_managing_emp_num IS NOT NULL) THEN
521:
522: -- dbms_output.put_line('For OTHER category, source_id, address_id, contact_id and managing_emp_id should be all null');
523:
524: fnd_message.set_name('JTF', 'JTF_RS_OTHER_IDS_NOT_NULL');
525: fnd_msg_pub.add;
526: RAISE fnd_api.g_exc_error;
527:
528: END IF;
536: /* Validate the source_id */
537:
538: IF (l_source_id IS NULL) THEN
539: -- dbms_output.put_line('For PARTNER category, source_id should not be null');
540: fnd_message.set_name('JTF', 'JTF_RS_PARTNER_IDS_NULL');
541: fnd_msg_pub.add;
542: RAISE fnd_api.g_exc_error;
543: ELSE
544: IF G_RS_ID_PUB_FLAG = 'Y' THEN --This flag is checked for migration purpose.
545: OPEN c_validate_partner(l_source_id);
546: FETCH c_validate_partner INTO l_check_flag;
547: IF c_validate_partner%NOTFOUND THEN
548: -- dbms_output.put_line('Partner does not exist for the passed source_id');
549: fnd_message.set_name('JTF', 'JTF_RS_INVALID_PARTNER_IDS');
550: fnd_msg_pub.add;
551: RAISE fnd_api.g_exc_error;
552: END IF;
553: CLOSE c_validate_partner;
556: FETCH c_validate_partner_migr INTO l_check_flag,l_source_name;
557: JTF_RESOURCE_UTL.G_SOURCE_NAME := l_source_name;
558: IF c_validate_partner_migr%NOTFOUND THEN
559: -- dbms_output.put_line('Partner does not exist for the passed source_id');
560: fnd_message.set_name('JTF', 'JTF_RS_INVALID_PARTNER_IDS');
561: fnd_msg_pub.add;
562: RAISE fnd_api.g_exc_error;
563: END IF;
564: CLOSE c_validate_partner_migr;
571: OPEN c_validate_partner_address(l_source_id, l_address_id);
572: FETCH c_validate_partner_address INTO l_check_flag;
573: IF c_validate_partner_address%NOTFOUND THEN
574: -- dbms_output.put_line('Invalid Partner Address Id');
575: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTNER_ADDRESS_ID');
576: fnd_message.set_token('P_ADDRESS_ID', l_address_id);
577: fnd_msg_pub.add;
578: RAISE fnd_api.g_exc_error;
579: END IF;
572: FETCH c_validate_partner_address INTO l_check_flag;
573: IF c_validate_partner_address%NOTFOUND THEN
574: -- dbms_output.put_line('Invalid Partner Address Id');
575: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTNER_ADDRESS_ID');
576: fnd_message.set_token('P_ADDRESS_ID', l_address_id);
577: fnd_msg_pub.add;
578: RAISE fnd_api.g_exc_error;
579: END IF;
580: CLOSE c_validate_partner_address;
587: OPEN c_validate_partner_contact(l_source_id, l_address_id, l_contact_id);
588: FETCH c_validate_partner_contact INTO l_check_flag;
589: IF c_validate_partner_contact%NOTFOUND THEN
590: -- dbms_output.put_line('Invalid Partner Contact Id');
591: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTNER_CONTACT_ID');
592: fnd_message.set_token('P_CONTACT_ID', l_contact_id);
593: fnd_msg_pub.add;
594: RAISE fnd_api.g_exc_error;
595: END IF;
588: FETCH c_validate_partner_contact INTO l_check_flag;
589: IF c_validate_partner_contact%NOTFOUND THEN
590: -- dbms_output.put_line('Invalid Partner Contact Id');
591: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTNER_CONTACT_ID');
592: fnd_message.set_token('P_CONTACT_ID', l_contact_id);
593: fnd_msg_pub.add;
594: RAISE fnd_api.g_exc_error;
595: END IF;
596: CLOSE c_validate_partner_contact;
605: */
606: IF l_category NOT IN ('OTHER' , 'PARTNER' , 'TBH', 'EMPLOYEE') THEN
607: IF l_source_id IS NULL THEN
608: -- dbms_output.put_line('Source Id should not be Null');
609: fnd_message.set_name('JTF', 'JTF_RS_SOURCE_ID_NULL');
610: fnd_msg_pub.add;
611: RAISE fnd_api.g_exc_error;
612: END IF;
613:
629: END IF;
630: END IF;
631:
632: IF l_found = FALSE THEN
633: fnd_message.set_name('JTF', 'JTF_RS_INVALID_SOURCE_ID');
634: fnd_message.set_token('P_SOURCE_ID', l_source_id);
635: fnd_msg_pub.add;
636: RAISE fnd_api.g_exc_error;
637: END IF;
630: END IF;
631:
632: IF l_found = FALSE THEN
633: fnd_message.set_name('JTF', 'JTF_RS_INVALID_SOURCE_ID');
634: fnd_message.set_token('P_SOURCE_ID', l_source_id);
635: fnd_msg_pub.add;
636: RAISE fnd_api.g_exc_error;
637: END IF;
638:
644:
645: if l_category = 'EMPLOYEE' THEN
646: -- First check is null check for source id
647: IF l_source_id IS NULL THEN
648: fnd_message.set_name('JTF', 'JTF_RS_SOURCE_ID_NULL');
649: fnd_msg_pub.add;
650: RAISE fnd_api.g_exc_error;
651: END IF;
652:
655: close c_emp_exist;
656:
657: if(nvl(r_emp_exist.value , 'y') <> 'x')
658: then
659: fnd_message.set_name('JTF', 'JTF_RS_INVALID_SOURCE_ID');
660: fnd_message.set_token('P_SOURCE_ID', l_source_id);
661: fnd_msg_pub.add;
662: RAISE fnd_api.g_exc_error;
663: end if;
656:
657: if(nvl(r_emp_exist.value , 'y') <> 'x')
658: then
659: fnd_message.set_name('JTF', 'JTF_RS_INVALID_SOURCE_ID');
660: fnd_message.set_token('P_SOURCE_ID', l_source_id);
661: fnd_msg_pub.add;
662: RAISE fnd_api.g_exc_error;
663: end if;
664:
680: IF c_validate_party_address%NOTFOUND THEN
681:
682: -- dbms_output.put_line('Invalid Party Address');
683:
684: fnd_message.set_name('JTF', 'JTF_RS_INVALID_PARTY_ADDRESS');
685: fnd_message.set_token('P_ADDRESS_ID', l_address_id);
686: fnd_msg_pub.add;
687:
688: RAISE fnd_api.g_exc_error;
681:
682: -- dbms_output.put_line('Invalid Party Address');
683:
684: fnd_message.set_name('JTF', 'JTF_RS_INVALID_PARTY_ADDRESS');
685: fnd_message.set_token('P_ADDRESS_ID', l_address_id);
686: fnd_msg_pub.add;
687:
688: RAISE fnd_api.g_exc_error;
689:
709: IF c_validate_party_contact%NOTFOUND THEN
710:
711: -- dbms_output.put_line('Invalid Party Contact Id');
712:
713: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTY_CONTACT_ID');
714: fnd_message.set_token('P_CONTACT_ID', l_contact_id);
715: fnd_msg_pub.add;
716:
717: RAISE fnd_api.g_exc_error;
710:
711: -- dbms_output.put_line('Invalid Party Contact Id');
712:
713: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTY_CONTACT_ID');
714: fnd_message.set_token('P_CONTACT_ID', l_contact_id);
715: fnd_msg_pub.add;
716:
717: RAISE fnd_api.g_exc_error;
718:
740: IF (l_contact_id IS NOT NULL) THEN
741:
742: -- dbms_output.put_line('For SUPPLIER_CONTACT category, address_id and contact_id should be null');
743:
744: fnd_message.set_name('JTF', 'JTF_RS_SC_IDS_NOT_NULL');
745: fnd_msg_pub.add;
746:
747: RAISE fnd_api.g_exc_error;
748:
762: IF (l_contact_id IS NOT NULL OR l_managing_emp_id IS NOT NULL OR l_managing_emp_num IS NOT NULL) THEN
763:
764: -- dbms_output.put_line('For EMPLOYEE category, contact_id should be null');
765:
766: fnd_message.set_name('JTF', 'JTF_RS_EMP_IDS_NOT_NULL');
767: fnd_msg_pub.add;
768:
769: RAISE fnd_api.g_exc_error;
770:
800: IF l_start_date_active IS NULL THEN
801:
802: -- dbms_output.put_line('Start Date Active cannot be null');
803:
804: fnd_message.set_name('JTF', 'JTF_RS_START_DATE_NULL');
805: fnd_msg_pub.add;
806:
807: RAISE fnd_api.g_exc_error;
808:
927: IF c_assigned_to_group_id%NOTFOUND THEN
928:
929: -- dbms_output.put_line('Invalid Assigned To Group Id');
930:
931: fnd_message.set_name('JTF', 'JTF_RS_ERR_ASSIGN_TO_GRP_ID');
932: fnd_message.set_token('P_ASSIGNED_TO_GROUP_ID', l_assigned_to_group_id);
933: fnd_msg_pub.add;
934: RAISE fnd_api.g_exc_error;
935:
928:
929: -- dbms_output.put_line('Invalid Assigned To Group Id');
930:
931: fnd_message.set_name('JTF', 'JTF_RS_ERR_ASSIGN_TO_GRP_ID');
932: fnd_message.set_token('P_ASSIGNED_TO_GROUP_ID', l_assigned_to_group_id);
933: fnd_msg_pub.add;
934: RAISE fnd_api.g_exc_error;
935:
936: END IF;
969: IF l_commissionable_flag <> 'Y' AND l_commissionable_flag <> 'N' THEN
970:
971: -- dbms_output.put_line('Commissionable Flag should either be ''Y'' or ''N'' ');
972:
973: fnd_message.set_name('JTF', 'JTF_RS_INVALID_FLAG_VALUE');
974: fnd_msg_pub.add;
975:
976: RAISE fnd_api.g_exc_error;
977:
983: IF l_hold_payment <> 'Y' AND l_hold_payment <> 'N' THEN
984:
985: -- dbms_output.put_line('Hold Payment should either be ''Y'' or ''N'' ');
986:
987: fnd_message.set_name('JTF', 'JTF_RS_INVALID_FLAG_VALUE');
988: fnd_msg_pub.add;
989: RAISE fnd_api.g_exc_error;
990:
991: END IF;
1018: IF l_category NOT IN ('EMPLOYEE', 'PARTY', 'SUPPLIER_CONTACT') THEN
1019:
1020: IF l_user_id IS NOT NULL THEN
1021:
1022: fnd_message.set_name('JTF', 'JTF_RS_USERID_ERROR');
1023: fnd_msg_pub.add;
1024:
1025: RAISE fnd_api.g_exc_error;
1026:
1057: IF c_validate_user_id%FOUND THEN
1058:
1059: -- dbms_output.put_line('duplicate user Id');
1060:
1061: fnd_message.set_name('JTF', 'JTF_RS_ERR_DUPLICATE_USER_ID');
1062: fnd_message.set_token('P_USER_ID', l_user_id);
1063: fnd_msg_pub.add;
1064:
1065: RAISE fnd_api.g_exc_error;
1058:
1059: -- dbms_output.put_line('duplicate user Id');
1060:
1061: fnd_message.set_name('JTF', 'JTF_RS_ERR_DUPLICATE_USER_ID');
1062: fnd_message.set_token('P_USER_ID', l_user_id);
1063: fnd_msg_pub.add;
1064:
1065: RAISE fnd_api.g_exc_error;
1066:
1309: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
1310: p_data => x_msg_data);
1311: WHEN OTHERS THEN
1312: ROLLBACK TO create_resource_pub;
1313: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
1314: fnd_message.set_token('P_SQLCODE',SQLCODE);
1315: fnd_message.set_token('P_SQLERRM',SQLERRM);
1316: fnd_message.set_token('P_API_NAME', l_api_name);
1317: FND_MSG_PUB.add;
1310: p_data => x_msg_data);
1311: WHEN OTHERS THEN
1312: ROLLBACK TO create_resource_pub;
1313: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
1314: fnd_message.set_token('P_SQLCODE',SQLCODE);
1315: fnd_message.set_token('P_SQLERRM',SQLERRM);
1316: fnd_message.set_token('P_API_NAME', l_api_name);
1317: FND_MSG_PUB.add;
1318: x_return_status := fnd_api.g_ret_sts_unexp_error;
1311: WHEN OTHERS THEN
1312: ROLLBACK TO create_resource_pub;
1313: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
1314: fnd_message.set_token('P_SQLCODE',SQLCODE);
1315: fnd_message.set_token('P_SQLERRM',SQLERRM);
1316: fnd_message.set_token('P_API_NAME', l_api_name);
1317: FND_MSG_PUB.add;
1318: x_return_status := fnd_api.g_ret_sts_unexp_error;
1319: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
1312: ROLLBACK TO create_resource_pub;
1313: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
1314: fnd_message.set_token('P_SQLCODE',SQLCODE);
1315: fnd_message.set_token('P_SQLERRM',SQLERRM);
1316: fnd_message.set_token('P_API_NAME', l_api_name);
1317: FND_MSG_PUB.add;
1318: x_return_status := fnd_api.g_ret_sts_unexp_error;
1319: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
1320: p_data => x_msg_data);
1578: IF l_resource_id IS NULL AND l_resource_number is NULL THEN
1579:
1580: -- dbms_output.put_line('Resource Id and Resource Number are null');
1581:
1582: fnd_message.set_name('JTF', 'JTF_RS_RESOURCE_NULL');
1583: fnd_msg_pub.add;
1584:
1585: RAISE fnd_api.g_exc_error;
1586:
1596: IF c_resource_id%NOTFOUND THEN
1597:
1598: -- dbms_output.put_line('Invalid or Inactive Resource');
1599:
1600: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE');
1601: fnd_message.set_token('P_RESOURCE_ID', l_resource_id);
1602: fnd_msg_pub.add;
1603:
1604: RAISE fnd_api.g_exc_error;
1597:
1598: -- dbms_output.put_line('Invalid or Inactive Resource');
1599:
1600: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE');
1601: fnd_message.set_token('P_RESOURCE_ID', l_resource_id);
1602: fnd_msg_pub.add;
1603:
1604: RAISE fnd_api.g_exc_error;
1605:
1616: IF c_resource_number%NOTFOUND THEN
1617:
1618: -- dbms_output.put_line('Invalid or Inactive Resource');
1619:
1620: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE_NUMBER');
1621: fnd_message.set_token('P_RESOURCE_NUMBER', l_resource_number);
1622: fnd_msg_pub.add;
1623:
1624: RAISE fnd_api.g_exc_error;
1617:
1618: -- dbms_output.put_line('Invalid or Inactive Resource');
1619:
1620: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE_NUMBER');
1621: fnd_message.set_token('P_RESOURCE_NUMBER', l_resource_number);
1622: fnd_msg_pub.add;
1623:
1624: RAISE fnd_api.g_exc_error;
1625:
1704: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
1705: p_data => x_msg_data);
1706: WHEN OTHERS THEN
1707: ROLLBACK TO update_resource_pub;
1708: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
1709: fnd_message.set_token('P_SQLCODE',SQLCODE);
1710: fnd_message.set_token('P_SQLERRM',SQLERRM);
1711: fnd_message.set_token('P_API_NAME', l_api_name);
1712: FND_MSG_PUB.add;
1705: p_data => x_msg_data);
1706: WHEN OTHERS THEN
1707: ROLLBACK TO update_resource_pub;
1708: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
1709: fnd_message.set_token('P_SQLCODE',SQLCODE);
1710: fnd_message.set_token('P_SQLERRM',SQLERRM);
1711: fnd_message.set_token('P_API_NAME', l_api_name);
1712: FND_MSG_PUB.add;
1713: x_return_status := fnd_api.g_ret_sts_unexp_error;
1706: WHEN OTHERS THEN
1707: ROLLBACK TO update_resource_pub;
1708: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
1709: fnd_message.set_token('P_SQLCODE',SQLCODE);
1710: fnd_message.set_token('P_SQLERRM',SQLERRM);
1711: fnd_message.set_token('P_API_NAME', l_api_name);
1712: FND_MSG_PUB.add;
1713: x_return_status := fnd_api.g_ret_sts_unexp_error;
1714: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
1707: ROLLBACK TO update_resource_pub;
1708: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
1709: fnd_message.set_token('P_SQLCODE',SQLCODE);
1710: fnd_message.set_token('P_SQLERRM',SQLERRM);
1711: fnd_message.set_token('P_API_NAME', l_api_name);
1712: FND_MSG_PUB.add;
1713: x_return_status := fnd_api.g_ret_sts_unexp_error;
1714: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
1715: p_data => x_msg_data);
1901: IF l_resource_id IS NULL AND l_resource_number is NULL THEN
1902:
1903: -- dbms_output.put_line('Resource Id and Resource Number are null');
1904:
1905: fnd_message.set_name('JTF', 'JTF_RS_RESOURCE_NULL');
1906: fnd_msg_pub.add;
1907:
1908: RAISE fnd_api.g_exc_error;
1909:
1919: IF c_resource_id%NOTFOUND THEN
1920:
1921: -- dbms_output.put_line('Invalid or Inactive Resource');
1922:
1923: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE');
1924: fnd_message.set_token('P_RESOURCE_ID', l_resource_id);
1925: fnd_msg_pub.add;
1926:
1927: RAISE fnd_api.g_exc_error;
1920:
1921: -- dbms_output.put_line('Invalid or Inactive Resource');
1922:
1923: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE');
1924: fnd_message.set_token('P_RESOURCE_ID', l_resource_id);
1925: fnd_msg_pub.add;
1926:
1927: RAISE fnd_api.g_exc_error;
1928:
1939: IF c_resource_number%NOTFOUND THEN
1940:
1941: -- dbms_output.put_line('Invalid or Inactive Resource');
1942:
1943: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE_NUMBER');
1944: fnd_message.set_token('P_RESOURCE_NUMBER', l_resource_number);
1945: fnd_msg_pub.add;
1946:
1947: RAISE fnd_api.g_exc_error;
1940:
1941: -- dbms_output.put_line('Invalid or Inactive Resource');
1942:
1943: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE_NUMBER');
1944: fnd_message.set_token('P_RESOURCE_NUMBER', l_resource_number);
1945: fnd_msg_pub.add;
1946:
1947: RAISE fnd_api.g_exc_error;
1948:
2074: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
2075: p_data => x_msg_data);
2076: WHEN OTHERS THEN
2077: ROLLBACK TO update_resource_pub;
2078: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
2079: fnd_message.set_token('P_SQLCODE',SQLCODE);
2080: fnd_message.set_token('P_SQLERRM',SQLERRM);
2081: fnd_message.set_token('P_API_NAME', l_api_name);
2082: FND_MSG_PUB.add;
2075: p_data => x_msg_data);
2076: WHEN OTHERS THEN
2077: ROLLBACK TO update_resource_pub;
2078: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
2079: fnd_message.set_token('P_SQLCODE',SQLCODE);
2080: fnd_message.set_token('P_SQLERRM',SQLERRM);
2081: fnd_message.set_token('P_API_NAME', l_api_name);
2082: FND_MSG_PUB.add;
2083: x_return_status := fnd_api.g_ret_sts_unexp_error;
2076: WHEN OTHERS THEN
2077: ROLLBACK TO update_resource_pub;
2078: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
2079: fnd_message.set_token('P_SQLCODE',SQLCODE);
2080: fnd_message.set_token('P_SQLERRM',SQLERRM);
2081: fnd_message.set_token('P_API_NAME', l_api_name);
2082: FND_MSG_PUB.add;
2083: x_return_status := fnd_api.g_ret_sts_unexp_error;
2084: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
2077: ROLLBACK TO update_resource_pub;
2078: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
2079: fnd_message.set_token('P_SQLCODE',SQLCODE);
2080: fnd_message.set_token('P_SQLERRM',SQLERRM);
2081: fnd_message.set_token('P_API_NAME', l_api_name);
2082: FND_MSG_PUB.add;
2083: x_return_status := fnd_api.g_ret_sts_unexp_error;
2084: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
2085: p_data => x_msg_data);
2133:
2134:
2135: /* Validate the Resource. */
2136: IF l_resource_id IS NULL THEN
2137: fnd_message.set_name('JTF', 'JTF_RS_RESOURCE_NULL');
2138: fnd_msg_pub.add;
2139: RAISE fnd_api.g_exc_error;
2140:
2141: END IF;
2144: IF l_resource_id IS NOT NULL THEN
2145: OPEN res_cur(l_resource_id);
2146: FETCH res_cur INTO res_rec;
2147: IF res_cur%NOTFOUND THEN
2148: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE');
2149: fnd_message.set_token('P_RESOURCE_ID', l_resource_id);
2150: fnd_msg_pub.add;
2151: RAISE fnd_api.g_exc_error;
2152:
2145: OPEN res_cur(l_resource_id);
2146: FETCH res_cur INTO res_rec;
2147: IF res_cur%NOTFOUND THEN
2148: fnd_message.set_name('JTF', 'JTF_RS_INVALID_RESOURCE');
2149: fnd_message.set_token('P_RESOURCE_ID', l_resource_id);
2150: fnd_msg_pub.add;
2151: RAISE fnd_api.g_exc_error;
2152:
2153: END IF;
2152:
2153: END IF;
2154: IF res_rec.category <> 'TBH'
2155: THEN
2156: fnd_message.set_name('JTF', 'JTF_RS_NOT_TBH');
2157: fnd_msg_pub.add;
2158: RAISE fnd_api.g_exc_error;
2159: END IF;
2160: CLOSE res_cur;
2200: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
2201: p_data => x_msg_data);
2202: WHEN OTHERS THEN
2203: ROLLBACK TO delete_resource_pub;
2204: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
2205: fnd_message.set_token('P_SQLCODE',SQLCODE);
2206: fnd_message.set_token('P_SQLERRM',SQLERRM);
2207: fnd_message.set_token('P_API_NAME', l_api_name);
2208: FND_MSG_PUB.add;
2201: p_data => x_msg_data);
2202: WHEN OTHERS THEN
2203: ROLLBACK TO delete_resource_pub;
2204: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
2205: fnd_message.set_token('P_SQLCODE',SQLCODE);
2206: fnd_message.set_token('P_SQLERRM',SQLERRM);
2207: fnd_message.set_token('P_API_NAME', l_api_name);
2208: FND_MSG_PUB.add;
2209: x_return_status := fnd_api.g_ret_sts_unexp_error;
2202: WHEN OTHERS THEN
2203: ROLLBACK TO delete_resource_pub;
2204: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
2205: fnd_message.set_token('P_SQLCODE',SQLCODE);
2206: fnd_message.set_token('P_SQLERRM',SQLERRM);
2207: fnd_message.set_token('P_API_NAME', l_api_name);
2208: FND_MSG_PUB.add;
2209: x_return_status := fnd_api.g_ret_sts_unexp_error;
2210: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
2203: ROLLBACK TO delete_resource_pub;
2204: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
2205: fnd_message.set_token('P_SQLCODE',SQLCODE);
2206: fnd_message.set_token('P_SQLERRM',SQLERRM);
2207: fnd_message.set_token('P_API_NAME', l_api_name);
2208: FND_MSG_PUB.add;
2209: x_return_status := fnd_api.g_ret_sts_unexp_error;
2210: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
2211: p_data => x_msg_data);
2663: OR l_managing_emp_num IS NOT NULL) THEN
2664:
2665: -- dbms_output.put_line('For OTHER category, source_id, address_id, contact_id and managing_emp_id should be all null');
2666:
2667: fnd_message.set_name('JTF', 'JTF_RS_OTHER_IDS_NOT_NULL');
2668: fnd_msg_pub.add;
2669:
2670: RAISE fnd_api.g_exc_error;
2671:
2680: /* Validate the source_id */
2681:
2682: IF (l_source_id IS NULL) THEN
2683: -- dbms_output.put_line('For PARTNER category, source_id should not be null');
2684: fnd_message.set_name('JTF', 'JTF_RS_PARTNER_IDS_NULL');
2685: fnd_msg_pub.add;
2686: RAISE fnd_api.g_exc_error;
2687:
2688: ELSE
2689: OPEN c_validate_partner(l_source_id);
2690: FETCH c_validate_partner INTO l_check_flag;
2691: IF c_validate_partner%NOTFOUND THEN
2692: -- dbms_output.put_line('Partner does not exist for the passed source_id');
2693: fnd_message.set_name('JTF', 'JTF_RS_INVALID_PARTNER_IDS');
2694: fnd_msg_pub.add;
2695: RAISE fnd_api.g_exc_error;
2696:
2697: END IF;
2704: OPEN c_validate_partner_address(l_source_id, l_address_id);
2705: FETCH c_validate_partner_address INTO l_check_flag;
2706: IF c_validate_partner_address%NOTFOUND THEN
2707: -- dbms_output.put_line('Invalid Partner Address Id');
2708: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTNER_ADDRESS_ID');
2709: fnd_message.set_token('P_ADDRESS_ID', l_address_id);
2710: fnd_msg_pub.add;
2711: RAISE fnd_api.g_exc_error;
2712:
2705: FETCH c_validate_partner_address INTO l_check_flag;
2706: IF c_validate_partner_address%NOTFOUND THEN
2707: -- dbms_output.put_line('Invalid Partner Address Id');
2708: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTNER_ADDRESS_ID');
2709: fnd_message.set_token('P_ADDRESS_ID', l_address_id);
2710: fnd_msg_pub.add;
2711: RAISE fnd_api.g_exc_error;
2712:
2713: END IF;
2721: OPEN c_validate_partner_contact(l_source_id, l_address_id, l_contact_id);
2722: FETCH c_validate_partner_contact INTO l_check_flag;
2723: IF c_validate_partner_contact%NOTFOUND THEN
2724: -- dbms_output.put_line('Invalid Partner Contact Id');
2725: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTNER_CONTACT_ID');
2726: fnd_message.set_token('P_CONTACT_ID', l_contact_id);
2727: fnd_msg_pub.add;
2728: RAISE fnd_api.g_exc_error;
2729:
2722: FETCH c_validate_partner_contact INTO l_check_flag;
2723: IF c_validate_partner_contact%NOTFOUND THEN
2724: -- dbms_output.put_line('Invalid Partner Contact Id');
2725: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTNER_CONTACT_ID');
2726: fnd_message.set_token('P_CONTACT_ID', l_contact_id);
2727: fnd_msg_pub.add;
2728: RAISE fnd_api.g_exc_error;
2729:
2730: END IF;
2741:
2742: IF l_category NOT IN ('OTHER' , 'PARTNER' , 'TBH', 'EMPLOYEE') THEN
2743: IF l_source_id IS NULL THEN
2744: -- dbms_output.put_line('Source Id should not be Null');
2745: fnd_message.set_name('JTF', 'JTF_RS_SOURCE_ID_NULL');
2746: fnd_msg_pub.add;
2747: RAISE fnd_api.g_exc_error;
2748:
2749: END IF;
2772: IF l_found = FALSE THEN
2773:
2774: -- dbms_output.put_line('Invalid Source Id');
2775:
2776: fnd_message.set_name('JTF', 'JTF_RS_INVALID_SOURCE_ID');
2777: fnd_message.set_token('P_SOURCE_ID', l_source_id);
2778: fnd_msg_pub.add;
2779:
2780: RAISE fnd_api.g_exc_error;
2773:
2774: -- dbms_output.put_line('Invalid Source Id');
2775:
2776: fnd_message.set_name('JTF', 'JTF_RS_INVALID_SOURCE_ID');
2777: fnd_message.set_token('P_SOURCE_ID', l_source_id);
2778: fnd_msg_pub.add;
2779:
2780: RAISE fnd_api.g_exc_error;
2781:
2791:
2792: if l_category = 'EMPLOYEE' THEN
2793: -- First check is null check for source id
2794: IF l_source_id IS NULL THEN
2795: fnd_message.set_name('JTF', 'JTF_RS_SOURCE_ID_NULL');
2796: fnd_msg_pub.add;
2797: RAISE fnd_api.g_exc_error;
2798: END IF;
2799:
2802: close c_emp_exist;
2803:
2804: if(nvl(r_emp_exist.value , 'y') <> 'x')
2805: then
2806: fnd_message.set_name('JTF', 'JTF_RS_INVALID_SOURCE_ID');
2807: fnd_message.set_token('P_SOURCE_ID', l_source_id);
2808: fnd_msg_pub.add;
2809: RAISE fnd_api.g_exc_error;
2810: end if;
2803:
2804: if(nvl(r_emp_exist.value , 'y') <> 'x')
2805: then
2806: fnd_message.set_name('JTF', 'JTF_RS_INVALID_SOURCE_ID');
2807: fnd_message.set_token('P_SOURCE_ID', l_source_id);
2808: fnd_msg_pub.add;
2809: RAISE fnd_api.g_exc_error;
2810: end if;
2811:
2827: IF c_validate_party_address%NOTFOUND THEN
2828:
2829: -- dbms_output.put_line('Invalid Party Address');
2830:
2831: fnd_message.set_name('JTF', 'JTF_RS_INVALID_PARTY_ADDRESS');
2832: fnd_message.set_token('P_ADDRESS_ID', l_address_id);
2833: fnd_msg_pub.add;
2834:
2835: RAISE fnd_api.g_exc_error;
2828:
2829: -- dbms_output.put_line('Invalid Party Address');
2830:
2831: fnd_message.set_name('JTF', 'JTF_RS_INVALID_PARTY_ADDRESS');
2832: fnd_message.set_token('P_ADDRESS_ID', l_address_id);
2833: fnd_msg_pub.add;
2834:
2835: RAISE fnd_api.g_exc_error;
2836:
2857: IF c_validate_party_contact%NOTFOUND THEN
2858:
2859: -- dbms_output.put_line('Invalid Party Contact Id');
2860:
2861: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTY_CONTACT_ID');
2862: fnd_message.set_token('P_CONTACT_ID', l_contact_id);
2863: fnd_msg_pub.add;
2864:
2865: RAISE fnd_api.g_exc_error;
2858:
2859: -- dbms_output.put_line('Invalid Party Contact Id');
2860:
2861: fnd_message.set_name('JTF', 'JTF_RS_ERR_PARTY_CONTACT_ID');
2862: fnd_message.set_token('P_CONTACT_ID', l_contact_id);
2863: fnd_msg_pub.add;
2864:
2865: RAISE fnd_api.g_exc_error;
2866:
2888: IF (l_contact_id IS NOT NULL) THEN
2889:
2890: -- dbms_output.put_line('For SUPPLIER_CONTACT category, address_id and contact_id should be null');
2891:
2892: fnd_message.set_name('JTF', 'JTF_RS_SC_IDS_NOT_NULL');
2893: fnd_msg_pub.add;
2894:
2895: RAISE fnd_api.g_exc_error;
2896:
2910: IF (l_contact_id IS NOT NULL OR l_managing_emp_id IS NOT NULL OR l_managing_emp_num IS NOT NULL) THEN
2911:
2912: -- dbms_output.put_line('For EMPLOYEE category, contact_id should be null');
2913:
2914: fnd_message.set_name('JTF', 'JTF_RS_EMP_IDS_NOT_NULL');
2915: fnd_msg_pub.add;
2916:
2917: RAISE fnd_api.g_exc_error;
2918:
2952: IF l_start_date_active IS NULL THEN
2953:
2954: -- dbms_output.put_line('Start Date Active cannot be null');
2955:
2956: fnd_message.set_name('JTF', 'JTF_RS_START_DATE_NULL');
2957: fnd_msg_pub.add;
2958:
2959: RAISE fnd_api.g_exc_error;
2960:
3090: IF c_assigned_to_group_id%NOTFOUND THEN
3091:
3092: -- dbms_output.put_line('Invalid Assigned To Group Id');
3093:
3094: fnd_message.set_name('JTF', 'JTF_RS_ERR_ASSIGN_TO_GRP_ID');
3095: fnd_message.set_token('P_ASSIGNED_TO_GROUP_ID', l_assigned_to_group_id);
3096: fnd_msg_pub.add;
3097:
3098: RAISE fnd_api.g_exc_error;
3091:
3092: -- dbms_output.put_line('Invalid Assigned To Group Id');
3093:
3094: fnd_message.set_name('JTF', 'JTF_RS_ERR_ASSIGN_TO_GRP_ID');
3095: fnd_message.set_token('P_ASSIGNED_TO_GROUP_ID', l_assigned_to_group_id);
3096: fnd_msg_pub.add;
3097:
3098: RAISE fnd_api.g_exc_error;
3099:
3136: IF l_commissionable_flag <> 'Y' AND l_commissionable_flag <> 'N' THEN
3137:
3138: -- dbms_output.put_line('Commissionable Flag should either be ''Y'' or ''N'' ');
3139:
3140: fnd_message.set_name('JTF', 'JTF_RS_INVALID_FLAG_VALUE');
3141: fnd_msg_pub.add;
3142:
3143: RAISE fnd_api.g_exc_error;
3144:
3151: IF l_hold_payment <> 'Y' AND l_hold_payment <> 'N' THEN
3152:
3153: -- dbms_output.put_line('Hold Payment should either be ''Y'' or ''N'' ');
3154:
3155: fnd_message.set_name('JTF', 'JTF_RS_INVALID_FLAG_VALUE');
3156: fnd_msg_pub.add;
3157:
3158: RAISE fnd_api.g_exc_error;
3159:
3190: IF l_category NOT IN ('EMPLOYEE', 'PARTY', 'SUPPLIER_CONTACT') THEN
3191:
3192: IF l_user_id IS NOT NULL THEN
3193:
3194: fnd_message.set_name('JTF', 'JTF_RS_USERID_ERROR');
3195: fnd_msg_pub.add;
3196:
3197: RAISE fnd_api.g_exc_error;
3198:
3229: IF c_validate_user_id%FOUND THEN
3230:
3231: -- dbms_output.put_line('duplicate user Id');
3232:
3233: fnd_message.set_name('JTF', 'JTF_RS_ERR_DUPLICATE_USER_ID');
3234: fnd_message.set_token('P_USER_ID', l_user_id);
3235: fnd_msg_pub.add;
3236:
3237: RAISE fnd_api.g_exc_error;
3230:
3231: -- dbms_output.put_line('duplicate user Id');
3232:
3233: fnd_message.set_name('JTF', 'JTF_RS_ERR_DUPLICATE_USER_ID');
3234: fnd_message.set_token('P_USER_ID', l_user_id);
3235: fnd_msg_pub.add;
3236:
3237: RAISE fnd_api.g_exc_error;
3238:
3479: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
3480: p_data => x_msg_data);
3481: WHEN OTHERS THEN
3482: ROLLBACK TO create_resource_sp;
3483: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
3484: fnd_message.set_token('P_SQLCODE',SQLCODE);
3485: fnd_message.set_token('P_SQLERRM',SQLERRM);
3486: fnd_message.set_token('P_API_NAME', l_api_name);
3487: FND_MSG_PUB.add;
3480: p_data => x_msg_data);
3481: WHEN OTHERS THEN
3482: ROLLBACK TO create_resource_sp;
3483: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
3484: fnd_message.set_token('P_SQLCODE',SQLCODE);
3485: fnd_message.set_token('P_SQLERRM',SQLERRM);
3486: fnd_message.set_token('P_API_NAME', l_api_name);
3487: FND_MSG_PUB.add;
3488: x_return_status := fnd_api.g_ret_sts_unexp_error;
3481: WHEN OTHERS THEN
3482: ROLLBACK TO create_resource_sp;
3483: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
3484: fnd_message.set_token('P_SQLCODE',SQLCODE);
3485: fnd_message.set_token('P_SQLERRM',SQLERRM);
3486: fnd_message.set_token('P_API_NAME', l_api_name);
3487: FND_MSG_PUB.add;
3488: x_return_status := fnd_api.g_ret_sts_unexp_error;
3489: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
3482: ROLLBACK TO create_resource_sp;
3483: fnd_message.set_name ('JTF', 'JTF_RS_UNEXP_ERROR');
3484: fnd_message.set_token('P_SQLCODE',SQLCODE);
3485: fnd_message.set_token('P_SQLERRM',SQLERRM);
3486: fnd_message.set_token('P_API_NAME', l_api_name);
3487: FND_MSG_PUB.add;
3488: x_return_status := fnd_api.g_ret_sts_unexp_error;
3489: FND_MSG_PUB.count_and_get (p_count => x_msg_count,
3490: p_data => x_msg_data);