1 Package Body pqh_trl_bus as
2 /* $Header: pqtrlrhi.pkb 115.3 2002/12/12 21:39:54 rpasapul noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pqh_trl_bus.'; -- Global package name
9 --
10 --
11 g_table_route_id number default null;
12 g_language varchar2(4) default null;
13 --
14 --
15 -- ----------------------------------------------------------------------------
16 -- |-----------------------< chk_non_updateable_args >------------------------|
17 -- ----------------------------------------------------------------------------
18 -- {Start Of Comments}
19 --
20 -- Description:
21 -- This procedure is used to ensure that non updateable attributes have
22 -- not been updated. If an attribute has been updated an error is generated.
23 --
24 -- Pre Conditions:
25 -- g_old_rec has been populated with details of the values currently in
26 -- the database.
27 --
28 -- In Arguments:
29 -- p_rec has been populated with the updated values the user would like the
30 -- record set to.
31 --
32 -- Post Success:
33 -- Processing continues if all the non updateable attributes have not
34 -- changed.
35 --
36 -- Post Failure:
37 -- An application error is raised if any of the non updatable attributes
38 -- have been altered.
39 --
40 -- {End Of Comments}
41 -- ----------------------------------------------------------------------------
42 Procedure chk_non_updateable_args
43 (p_rec in pqh_trl_shd.g_rec_type
44 ) IS
45 --
46 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
47 l_error EXCEPTION;
48 l_argument varchar2(30);
49 --
50 Begin
51 --
52 -- Only proceed with the validation if a row exists for the current
53 -- record in the HR Schema.
54 --
55 IF NOT pqh_trl_shd.api_updating
56 (p_table_route_id => p_rec.table_route_id
57 ,p_language => p_rec.language
58 ) THEN
59 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
60 fnd_message.set_token('PROCEDURE ', l_proc);
61 fnd_message.set_token('STEP ', '5');
62 fnd_message.raise_error;
63 END IF;
64 --
65 -- EDIT_HERE: Add checks to ensure non-updateable args have
66 -- not been updated.
67 --
68 EXCEPTION
69 WHEN l_error THEN
70 hr_api.argument_changed_error
71 (p_api_name => l_proc
72 ,p_argument => l_argument);
73 WHEN OTHERS THEN
74 RAISE;
75 End chk_non_updateable_args;
76 --
77 -- ----------------------------------------------------------------------------
78 -- |---------------------------< insert_validate >----------------------------|
79 -- ----------------------------------------------------------------------------
80 Procedure insert_validate
81 (p_rec in pqh_trl_shd.g_rec_type
82 ) is
83 --
84 l_proc varchar2(72) := g_package||'insert_validate';
85 --
86 Begin
87 hr_utility.set_location('Entering:'||l_proc, 5);
88 --
89 -- Call all supporting business operations
90 --
91 --
92 hr_utility.set_location(' Leaving:'||l_proc, 10);
93 End insert_validate;
94 --
95 -- ----------------------------------------------------------------------------
96 -- |---------------------------< update_validate >----------------------------|
97 -- ----------------------------------------------------------------------------
98 Procedure update_validate
99 (p_rec in pqh_trl_shd.g_rec_type
100 ) is
101 --
102 l_proc varchar2(72) := g_package||'update_validate';
103 --
104 Begin
105 hr_utility.set_location('Entering:'||l_proc, 5);
106 --
107 -- Call all supporting business operations
108 --
109 --
110 chk_non_updateable_args
111 (p_rec => p_rec
112 );
113 --
114 --
115 hr_utility.set_location(' Leaving:'||l_proc, 10);
116 End update_validate;
117 --
118 -- ----------------------------------------------------------------------------
119 -- |---------------------------< delete_validate >----------------------------|
120 -- ----------------------------------------------------------------------------
121 Procedure delete_validate
122 (p_rec in pqh_trl_shd.g_rec_type
123 ) is
124 --
125 l_proc varchar2(72) := g_package||'delete_validate';
126 --
127 Begin
128 hr_utility.set_location('Entering:'||l_proc, 5);
129 --
130 -- Call all supporting business operations
131 --
132 hr_utility.set_location(' Leaving:'||l_proc, 10);
133 End delete_validate;
134 --
135 end pqh_trl_bus;