[Home] [Help]
PACKAGE BODY: APPS.GL_PUBLIC_SECTOR
Source
1 PACKAGE BODY GL_PUBLIC_SECTOR AS
2 /* $Header: glgvutlb.pls 120.1 2005/05/05 02:05:57 kvora noship $ */
3
4 --
5 -- GET_MESSAGE_NAME :
6 --
7 -- If profile option INDUSTRY = 'G' for the user's responsibility and a government message name exists
8 -- Return the government message name. Otherwise, return the commercial message name.
9 --
10
11 FUNCTION GET_MESSAGE_NAME(p_message_name IN VARCHAR2,
12 p_app_short_name IN VARCHAR2,
13 p_user_resp_id IN NUMBER DEFAULT NULL) RETURN VARCHAR2 IS
14
15 l_user_id fnd_user.user_id%TYPE := NULL;
16 l_resp_appl_id fnd_application.application_id%TYPE := FND_GLOBAL.RESP_APPL_ID;
17 l_user_resp_id fnd_responsibility.responsibility_id%TYPE := p_user_resp_id;
18
19 l_value fnd_profile_option_values.profile_option_value%TYPE;
20 l_defined BOOLEAN;
21
22 l_gov_message_name fnd_new_messages.message_name%type;
23 l_temp_message_name VARCHAR2(40) := p_message_name||'_G';
24
25 BEGIN
26 -- Initialize user's responsibility
27
28 IF l_user_resp_id IS NULL THEN
29 l_user_resp_id := FND_GLOBAL.RESP_ID;
30 END IF;
31
32 FND_PROFILE.GET_SPECIFIC('INDUSTRY',
33 l_user_id,
34 l_user_resp_id,
35 l_resp_appl_id,
36 l_value,
37 l_defined);
38
39 IF l_defined AND l_value = 'G' THEN
40
41 IF FND_MESSAGE.GET_NUMBER(p_app_short_name, l_temp_message_name) IS NULL THEN
42
43 l_gov_message_name := p_message_name;
44
45 ELSE
46 l_gov_message_name := l_temp_message_name;
47
48 END IF;
49
50 ELSE
51 l_gov_message_name := p_message_name;
52
53 END IF;
54
55 RETURN l_gov_message_name;
56
57 EXCEPTION
58
59 WHEN others THEN
60
61 RETURN p_message_name;
62
63 END GET_MESSAGE_NAME;
64
65 END GL_PUBLIC_SECTOR;