667: savepoint create_lookup_value;
668: --
669: -- Enable multi messaging
670: --
671: if not hr_multi_message.is_message_list_enabled then
672: hr_multi_message.enable_message_list;
673: end if;
674: --
675: -- check that lookup type about to be created is either of type
668: --
669: -- Enable multi messaging
670: --
671: if not hr_multi_message.is_message_list_enabled then
672: hr_multi_message.enable_message_list;
673: end if;
674: --
675: -- check that lookup type about to be created is either of type
676: -- HIERARCHY_TYPE or HIERARCHY_NODE_TYPE only
679: if g_debug then
680: hr_utility.set_location('Error: Invalid lookup Type', 20);
681: end if;
682: fnd_message.set_name('PQH','PQH_GHR_INVALID_LOOKUP_TYPE');
683: hr_multi_message.add;
684: else
685: --
686: -- Code has been supplied so lets check its unique
687: -- within the lookup type before proceeding...
695: -- raise error as the supplied lookup_code already exists
696: fnd_message.set_name('PQH','PQH_GHR_LOOKUP_CODE_EXISTS');
697: fnd_message.set_token('TYPE',p_lookup_type);
698: fnd_message.set_token('CODE',p_lookup_code);
699: hr_multi_message.add;
700: else
701: close csr_lookup_code_unique;
702: l_lookup_code := p_lookup_code;
703: end if;
714: -- raise error as the supplied meaning already exists
715: fnd_message.set_name('PQH','PQH_GHR_LOOKUP_MEANING_EXISTS');
716: fnd_message.set_token('TYPE',p_lookup_type);
717: fnd_message.set_token('MEANING',p_meaning);
718: hr_multi_message.add;
719: else
720: close csr_lookup_meaning_unique;
721: l_lookup_code := p_lookup_code;
722: end if;
723: end if;
724: --
725: -- Stop processing if errors encountered
726: --
727: hr_multi_message.end_validation_set;
728: --
729: if g_debug then
730: hr_utility.set_location('No Validation Failures so far', 50);
731: end if;
771: -- Set return value to 'Y'
772: --
773: p_return_status := 'Y';
774: --
775: hr_multi_message.disable_message_list;
776: if g_debug then
777: hr_utility.set_location('Leaving:'||l_proc, 60);
778: end if;
779: exception
776: if g_debug then
777: hr_utility.set_location('Leaving:'||l_proc, 60);
778: end if;
779: exception
780: when hr_multi_message.error_message_exist then
781: --
782: -- Error message(s) exist
783: --
784: rollback to create_lookup_value;
782: -- Error message(s) exist
783: --
784: rollback to create_lookup_value;
785: p_return_status := 'N';
786: hr_multi_message.disable_message_list;
787: if g_debug then
788: hr_utility.set_location('Errors Exist:'||l_proc, 70);
789: end if;
790: when others then
792: -- An unexpected error has occured
793: --
794: rollback to create_lookup_value;
795: p_return_status := 'N';
796: hr_multi_message.disable_message_list;
797: if g_debug then
798: hr_utility.set_location('Unexpected Error:'||l_proc, 80);
799: end if;
800: fnd_message.set_name('PQH','PQH_GHR_LOOKUP_INS_FAIL');
905: --
906: --
907: -- Enable multi messaging
908: --
909: if not hr_multi_message.is_message_list_enabled then
910: hr_multi_message.enable_message_list;
911: end if;
912: --
913: -- Check for duplicate shared type entry
906: --
907: -- Enable multi messaging
908: --
909: if not hr_multi_message.is_message_list_enabled then
910: hr_multi_message.enable_message_list;
911: end if;
912: --
913: -- Check for duplicate shared type entry
914: --
920: hr_utility.set_location('Error: Duplicate shared type', 20);
921: end if;
922: -- raise error as the supplied lookup_code already exists
923: fnd_message.set_name('PQH','PQH_GHR_SHARED_TYPE_DUP');
924: hr_multi_message.add;
925: else
926: close csr_shared_type_entry_unique;
927: end if;
928: --
927: end if;
928: --
929: -- Do not proceed if there are errors
930: --
931: hr_multi_message.end_validation_set;
932: --
933: if g_debug then
934: hr_utility.set_location('No Validation Errors So Far', 30);
935: end if;
950: ,p_lookup_type => 'HIERARCHY_TYPE'
951: ,p_effective_date => sysdate
952: );
953:
954: hr_multi_message.disable_message_list;
955: if g_debug then
956: hr_utility.set_location('Leaving:'||l_proc, 40);
957: end if;
958: Exception
955: if g_debug then
956: hr_utility.set_location('Leaving:'||l_proc, 40);
957: end if;
958: Exception
959: when hr_multi_message.error_message_exist then
960: --
961: -- Error message exists
962: --
963: rollback to create_shared_type;
960: --
961: -- Error message exists
962: --
963: rollback to create_shared_type;
964: hr_multi_message.disable_message_list;
965: if g_debug then
966: hr_utility.set_location('Error messages exist:'||l_proc, 50);
967: end if;
968: --
973: rollback to create_shared_type;
974: if g_debug then
975: hr_utility.set_location('Unexpected Error'||l_proc, 60);
976: end if;
977: hr_multi_message.disable_message_list;
978: fnd_message.set_name('PQH','PQH_GHR_SHARED_TYPE_INS_FAIL');
979: fnd_msg_pub.add;
980: end create_shared_type;
981: --