[Home] [Help]
PACKAGE BODY: APPS.PQH_RER_BUS
Source
1 Package Body pqh_rer_bus as
2 /* $Header: pqrerrhi.pkb 120.0 2005/10/06 14:53 srajakum noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pqh_rer_bus.'; -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code varchar2(150) default null;
14 g_rate_element_relation_id number default null;
15 --
16 -- ---------------------------------------------------------------------------
17 -- |----------------------< set_security_group_id >--------------------------|
18 -- ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21 (p_rate_element_relation_id in number
22 ,p_associated_column1 in varchar2 default null
23 ) is
24 --
25 -- Declare cursor
26 --
27 cursor csr_sec_grp is
28 select pbg.security_group_id,
29 pbg.legislation_code
30 from per_business_groups_perf pbg
31 , pqh_rate_element_relations rer
32 where rer.rate_element_relation_id = p_rate_element_relation_id
33 and pbg.business_group_id (+) = rer.business_group_id;
34 --
35 -- Declare local variables
36 --
37 l_security_group_id number;
38 l_proc varchar2(72) := g_package||'set_security_group_id';
39 l_legislation_code varchar2(150);
40 --
41 begin
42 --
43 hr_utility.set_location('Entering:'|| l_proc, 10);
44 --
45 -- Ensure that all the mandatory parameter are not null
46 --
47 hr_api.mandatory_arg_error
48 (p_api_name => l_proc
49 ,p_argument => 'rate_element_relation_id'
50 ,p_argument_value => p_rate_element_relation_id
51 );
52 --
53 open csr_sec_grp;
54 fetch csr_sec_grp into l_security_group_id
55 , l_legislation_code;
56 --
57 if csr_sec_grp%notfound then
58 --
59 close csr_sec_grp;
60 --
61 -- The primary key is invalid therefore we must error
62 --
63 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
64 hr_multi_message.add
65 (p_associated_column1
66 => nvl(p_associated_column1,'RATE_ELEMENT_RELATION_ID')
67 );
68 --
69 else
70 close csr_sec_grp;
71 --
72 -- Set the security_group_id in CLIENT_INFO
73 --
74 hr_api.set_security_group_id
75 (p_security_group_id => l_security_group_id
76 );
77 --
78 -- Set the sessions legislation context in HR_SESSION_DATA
79 --
80 hr_api.set_legislation_context(l_legislation_code);
81 end if;
82 --
83 hr_utility.set_location(' Leaving:'|| l_proc, 20);
84 --
85 end set_security_group_id;
86 --
87 -- ---------------------------------------------------------------------------
88 -- |---------------------< return_legislation_code >-------------------------|
89 -- ---------------------------------------------------------------------------
90 --
91 Function return_legislation_code
92 (p_rate_element_relation_id in number
93 )
94 Return Varchar2 Is
95 --
96 -- Declare cursor
97 --
98 cursor csr_leg_code is
99 select pbg.legislation_code
100 from per_business_groups_perf pbg
101 , pqh_rate_element_relations rer
102 where rer.rate_element_relation_id = p_rate_element_relation_id
103 and pbg.business_group_id (+) = rer.business_group_id;
104 --
105 -- Declare local variables
106 --
107 l_legislation_code varchar2(150);
108 l_proc varchar2(72) := g_package||'return_legislation_code';
109 --
110 Begin
111 --
112 hr_utility.set_location('Entering:'|| l_proc, 10);
113 --
114 -- Ensure that all the mandatory parameter are not null
115 --
116 hr_api.mandatory_arg_error
117 (p_api_name => l_proc
118 ,p_argument => 'rate_element_relation_id'
119 ,p_argument_value => p_rate_element_relation_id
120 );
121 --
122 if ( nvl(pqh_rer_bus.g_rate_element_relation_id, hr_api.g_number)
123 = p_rate_element_relation_id) then
124 --
125 -- The legislation code has already been found with a previous
126 -- call to this function. Just return the value in the global
127 -- variable.
128 --
129 l_legislation_code := pqh_rer_bus.g_legislation_code;
130 hr_utility.set_location(l_proc, 20);
131 else
132 --
133 -- The ID is different to the last call to this function
134 -- or this is the first call to this function.
135 --
136 open csr_leg_code;
137 fetch csr_leg_code into l_legislation_code;
138 --
139 if csr_leg_code%notfound then
140 --
141 -- The primary key is invalid therefore we must error
142 --
143 close csr_leg_code;
144 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
145 fnd_message.raise_error;
146 end if;
147 hr_utility.set_location(l_proc,30);
148 --
149 -- Set the global variables so the values are
150 -- available for the next call to this function.
151 --
152 close csr_leg_code;
153 pqh_rer_bus.g_rate_element_relation_id := p_rate_element_relation_id;
154 pqh_rer_bus.g_legislation_code := l_legislation_code;
155 end if;
156 hr_utility.set_location(' Leaving:'|| l_proc, 40);
157 return l_legislation_code;
158 end return_legislation_code;
159 --
160 -- ----------------------------------------------------------------------------
161 -- |-----------------------< chk_non_updateable_args >------------------------|
162 -- ----------------------------------------------------------------------------
163 -- {Start Of Comments}
164 --
165 -- Description:
166 -- This procedure is used to ensure that non updateable attributes have
167 -- not been updated. If an attribute has been updated an error is generated.
168 --
169 -- Pre Conditions:
170 -- g_old_rec has been populated with details of the values currently in
171 -- the database.
172 --
173 -- In Arguments:
174 -- p_rec has been populated with the updated values the user would like the
175 -- record set to.
176 --
177 -- Post Success:
178 -- Processing continues if all the non updateable attributes have not
179 -- changed.
180 --
181 -- Post Failure:
182 -- An application error is raised if any of the non updatable attributes
183 -- have been altered.
184 --
185 -- {End Of Comments}
186 -- ----------------------------------------------------------------------------
187 Procedure chk_non_updateable_args
188 (p_effective_date in date
189 ,p_rec in pqh_rer_shd.g_rec_type
190 ) IS
191 --
192 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
193 --
194 Begin
195 --
196 -- Only proceed with the validation if a row exists for the current
197 -- record in the HR Schema.
198 --
199 IF NOT pqh_rer_shd.api_updating
200 (p_rate_element_relation_id => p_rec.rate_element_relation_id
201 ,p_object_version_number => p_rec.object_version_number
202 ) THEN
203 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
204 fnd_message.set_token('PROCEDURE ', l_proc);
205 fnd_message.set_token('STEP ', '5');
206 fnd_message.raise_error;
207 END IF;
208 --
209 -- EDIT_HERE: Add checks to ensure non-updateable args have
210 -- not been updated.
211 --
212 --
213 if nvl(p_rec.business_group_id, hr_api.g_number) <>
214 nvl(pqh_rer_shd.g_old_rec.business_group_id
215 ,hr_api.g_number
216 ) then
217 hr_api.argument_changed_error
218 (p_api_name => l_proc
219 ,p_argument => 'BUSINESS_GROUP_ID'
220 ,p_base_table => pqh_rer_shd.g_tab_nam
221 );
222 end if;
223 --
224 End chk_non_updateable_args;
225 --
226 -- ----------------------------------------------------------------------------
227 -- |----------------------< chk_startup_action >------------------------------|
228 -- ----------------------------------------------------------------------------
229 --
230 -- Description:
231 -- This procedure will check that the current action is allowed according
232 -- to the current startup mode.
233 --
234 -- ----------------------------------------------------------------------------
235 PROCEDURE chk_startup_action
236 (p_insert IN boolean
237 ,p_business_group_id IN number
238 ,p_legislation_code IN varchar2
239 ,p_legislation_subgroup IN varchar2 DEFAULT NULL) IS
240 --
241 BEGIN
242 --
243 -- Call the supporting procedure to check startup mode
244 -- EDIT_HERE: The following call should be edited if certain types of rows
245 -- are not permitted.
246 IF (p_insert) THEN
247 hr_startup_data_api_support.chk_startup_action
248 (p_generic_allowed => TRUE
249 ,p_startup_allowed => TRUE
250 ,p_user_allowed => TRUE
251 ,p_business_group_id => p_business_group_id
252 ,p_legislation_code => p_legislation_code
253 ,p_legislation_subgroup => p_legislation_subgroup
254 );
255 ELSE
256 hr_startup_data_api_support.chk_upd_del_startup_action
257 (p_generic_allowed => TRUE
258 ,p_startup_allowed => TRUE
259 ,p_user_allowed => TRUE
260 ,p_business_group_id => p_business_group_id
261 ,p_legislation_code => p_legislation_code
262 ,p_legislation_subgroup => p_legislation_subgroup
263 );
264 END IF;
265 --
266 END chk_startup_action;
267 --
268
269
270
271
272 -- ----------------------------------------------------------------------------
273 -- |------< chk_criteria_rate_element_id------|
274 -- ----------------------------------------------------------------------------
275
276 -- Description
277 -- This procedure checks that a referenced foreign key actually exists
278 -- in the referenced table.
279 --
280 -- Pre-Conditions
281 -- None.
282 --
283 -- In Parameters
284 -- p_rate_element_relation_id PK
285 -- p_criteria_rate_element_id ID of FK column
286 -- p_object_version_number object version number
287 --
288 -- Post Success
289 -- Processing continues
290 --
291 -- Post Failure
292 -- Error raised.
293 --
294 -- Access Status
295 -- Internal table handler use only.
296 --
297
298 Procedure chk_criteria_rate_element_id (p_rate_element_relation_id in number,
299 p_criteria_rate_element_id in number,
300 p_object_version_number in number) is
301 --
302 l_proc varchar2(72) := g_package||'chk_criteria_rate_element_id';
303 l_api_updating boolean;
304 l_dummy varchar2(1);
305
306 cursor c1 is
307 select null from PQH_CRITERIA_RATE_ELEMENTS a
308 where a.criteria_rate_element_id = p_criteria_rate_element_id;
309
310 --
311 Begin
312 --
313 hr_utility.set_location('Entering:'||l_proc,10);
314 --
315
316 l_api_updating := pqh_rer_shd.api_updating
317 (p_rate_element_relation_id => p_rate_element_relation_id,
318 p_object_version_number => p_object_version_number);
319 --
320 if (l_api_updating
321 and nvl(p_criteria_rate_element_id,hr_api.g_number)
322 <> nvl(pqh_rer_shd.g_old_rec.criteria_rate_element_id,hr_api.g_number)
323 or not l_api_updating) then
324 --
325 -- check if criteria_rate_element_id value exists in
326 -- PQH_CRITERIA_RATE_ELEMENTS table
327 --
328 open c1;
329 --
330
331
332 fetch c1 into l_dummy;
333
334 if c1%notfound then
335 --
336 close c1;
337 --
338 -- raise error as FK does not relate to PK in PQH_CRITERIA_RATE_ELEMENTS
339 -- table.
340 --
341 pqh_rer_shd.constraint_error('PQH_RATE_ELEMENT_RELATIONS_FK1');
342 --
343 end if;
344 --
345 close c1;
346
347 --
348 --
349 end if;
350 --
351 hr_utility.set_location('Leaving:'||l_proc,90);
352 --
353 End chk_criteria_rate_element_id;
354 --
355
356
357
358
359
360
361
362 -- ----------------------------------------------------------------------------
363 -- |------< chk_rel_element_type_id------|
364 -- ----------------------------------------------------------------------------
365
366 -- Description
367 -- This procedure checks that a referenced foreign key actually exists
368 -- in the referenced table.
369 --
370 -- Pre-Conditions
371 -- None.
372 --
373 -- In Parameters
374 -- p_rate_element_relation_id PK
375 -- p_rel_element_type_id ID of FK column
376 -- p_object_version_number object version number
377 --
378 -- Post Success
379 -- Processing continues
380 --
381 -- Post Failure
382 -- Error raised.
383 --
384 -- Access Status
385 -- Internal table handler use only.
386 --
387 Procedure chk_rel_element_type_id (p_rate_element_relation_id in number,
388 p_rel_element_type_id in number,
389 p_object_version_number in number) is
390 --
391 l_proc varchar2(72) := g_package||'chk_rel_element_type_id';
392 l_api_updating boolean;
393 l_dummy varchar2(1);
394
395 cursor c1 is
396 select null from PAY_ELEMENT_TYPES_F a
397 where a.element_type_id = p_rel_element_type_id;
398
399 --
400 Begin
401 --
402 hr_utility.set_location('Entering:'||l_proc,10);
403 --
404
405 l_api_updating := pqh_rer_shd.api_updating
406 (p_rate_element_relation_id => p_rate_element_relation_id,
407 p_object_version_number => p_object_version_number);
408 --
409 if (l_api_updating
410 and nvl(p_rel_element_type_id,hr_api.g_number)
411 <> nvl(pqh_rer_shd.g_old_rec.rel_element_type_id,hr_api.g_number)
412 or not l_api_updating) then
413 --
414 -- check if rel_element_type_id value exists in
415 -- PAY_ELEMENT_TYPES_F table
416 --
417 open c1;
418 --
419
420
421 fetch c1 into l_dummy;
422
423 if c1%notfound then
424 --
425 close c1;
426 --
427 -- raise error as FK does not relate to PK in PAY_ELEMENT_TYPES_F
428 -- table.
429 --
430 pqh_rer_shd.constraint_error('PQH_RATE_ELEMENT_RELATIONS_FK4');
431 --
432 end if;
433 --
434 close c1;
435
436 --
437 --
438 end if;
439 --
440 hr_utility.set_location('Leaving:'||l_proc,90);
441 --
442 End chk_rel_element_type_id;
443 --
444
445 -- ----------------------------------------------------------------------------
446 -- |------< chk_rel_input_value_id------|
447 -- ----------------------------------------------------------------------------
448
449 -- Description
450 -- This procedure checks that a referenced foreign key actually exists
451 -- in the referenced table.
452 --
453 -- Pre-Conditions
454 -- None.
455 --
456 -- In Parameters
457 -- p_rate_element_relation_id PK
458 -- p_rel_input_value_id ID of FK column
459 -- p_object_version_number object version number
460 --
461 -- Post Success
462 -- Processing continues
463 --
464 -- Post Failure
465 -- Error raised.
466 --
467 -- Access Status
468 -- Internal table handler use only.
469 --
470 Procedure chk_rel_input_value_id (p_rate_element_relation_id in number,
471 p_rel_input_value_id in number,
472 p_object_version_number in number) is
473 --
474 l_proc varchar2(72) := g_package||'chk_rel_input_value_id';
475 l_api_updating boolean;
476 l_dummy varchar2(1);
477
478 cursor c1 is
479 select null from PAY_INPUT_VALUES_F a
480 where a.input_value_id = p_rel_input_value_id;
481
482 --
483 Begin
484 --
485 hr_utility.set_location('Entering:'||l_proc,10);
486 --
487
488 l_api_updating := pqh_rer_shd.api_updating
489 (p_rate_element_relation_id => p_rate_element_relation_id,
490 p_object_version_number => p_object_version_number);
491 --
492 if (l_api_updating
493 and nvl(p_rel_input_value_id,hr_api.g_number)
494 <> nvl(pqh_rer_shd.g_old_rec.rel_input_value_id,hr_api.g_number)
495 or not l_api_updating) then
496 --
497 -- check if rel_input_value_id value exists in
498 -- PAY_INPUT_VALUE_F table
499 --
500 open c1;
501 --
502
503
504 fetch c1 into l_dummy;
505
506 if c1%notfound then
507 --
508 close c1;
509 --
510 -- raise error as FK does not relate to PK in PAY_INPUT_VALUE_F
511 -- table.
512 --
513 pqh_rer_shd.constraint_error('PQH_RATE_ELEMENT_RELATIONS_FK5');
514 --
515 end if;
516 --
517 close c1;
518
519 --
520 --
521 end if;
522 --
523 hr_utility.set_location('Leaving:'||l_proc,90);
524 --
525 End chk_rel_input_value_id;
526 --
527 -- ----------------------------------------------------------------------------
528 -- |------< chk_business_group_id ------|
529 -- ----------------------------------------------------------------------------
530
531 -- Description
532 -- This procedure checks that a referenced foreign key actually exists
533 -- in the referenced table.
534 --
535 -- Pre-Conditions
536 -- None.
537 --
538 -- In Parameters
539 -- p_rate_element_relation_id PK
540 -- p_business_group_id ID of FK column
541 -- p_object_version_number object version number
542 --
543 -- Post Success
544 -- Processing continues
545 --
546 -- Post Failure
547 -- Error raised.
548 --
549 -- Access Status
550 -- Internal table handler use only.
551 --
552 Procedure chk_business_group_id (p_rate_element_relation_id in number,
553 p_business_group_id in number,
554 p_object_version_number in number) is
555 --
556 l_proc varchar2(72) := g_package||'chk_business_group_id ';
557 l_api_updating boolean;
558 l_dummy varchar2(1);
559
560 cursor c1 is
561 select null from HR_ALL_ORGANIZATION_UNITS a
562 where a.business_group_id = p_business_group_id ;
563
564 --
565 Begin
566 --
567 hr_utility.set_location('Entering:'||l_proc,10);
568 --
569
570 l_api_updating := pqh_rer_shd.api_updating
571 (p_rate_element_relation_id => p_rate_element_relation_id,
572 p_object_version_number => p_object_version_number);
573 --
574 if (l_api_updating
575 and nvl(p_business_group_id ,hr_api.g_number)
576 <> nvl(pqh_rer_shd.g_old_rec.business_group_id ,hr_api.g_number)
577 or not l_api_updating) then
578 --
579 -- check if business_group_id value exists in
580 -- HR_ALL_ORGANIZATION_UNITS table
581 --
582 open c1;
583 --
584
585
586 fetch c1 into l_dummy;
587
588 if c1%notfound then
589 --
590 close c1;
591 --
592 -- raise error as FK does not relate to PK in HR_ALL_ORGANIZATION_UNITS
593 -- table.
594 --
595 pqh_rer_shd.constraint_error('PQH_RATE_ELEMENT_RELATIONS_FK3');
596 --
597 end if;
598 --
599 close c1;
600
601 --
602 --
603 end if;
604 --
605 hr_utility.set_location('Leaving:'||l_proc,90);
606 --
607 End chk_business_group_id ;
608 --
609 -- ----------------------------------------------------------------------------
610 -- |-------------------< chk_relation_type_cd >----------------------------|
611 -- ----------------------------------------------------------------------------
612 Procedure chk_relation_type_cd
613 (p_rate_element_relation_id in number,
614 p_relation_type_cd in varchar2,
615 p_effective_date in date,
616 p_object_version_number in number) is
617 --
618 l_proc varchar2(72) := g_package||'chk_relation_type_cd';
619 l_api_updating boolean;
620 --
621 Begin
622 --
623 hr_utility.set_location('Entering:'||l_proc, 10);
624 --
625 l_api_updating := pqh_rer_shd.api_updating
626 (p_rate_element_relation_id => p_rate_element_relation_id,
627 p_object_version_number => p_object_version_number);
628 --
629 if (l_api_updating
630 and p_relation_type_cd
631 <> nvl(pqh_rer_shd.g_old_rec.relation_type_cd,hr_api.g_varchar2)
632 or not l_api_updating)
633 and p_relation_type_cd is not null then
634
635 -- check if value of lookup falls within lookup type.
636
637 if hr_api.not_exists_in_hr_lookups
638 (p_lookup_type => 'PQH_RBC_ELMNT_RELATION_TYPE',
639 p_lookup_code => p_relation_type_cd,
640 p_effective_date => p_effective_date) then
641 --
642 -- raise error as does not exist as lookup
643 --
644 hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
645 hr_utility.raise_error;
646 --
647 end if;
648 --
649 end if;
650 --
651 hr_utility.set_location('Leaving:'||l_proc,90);
652 --
653 end chk_relation_type_cd;
654
655
656
657
658 -- ----------------------------------------------------------------------------
659 -- |---------------------------< insert_validate >----------------------------|
660 -- ----------------------------------------------------------------------------
661 Procedure insert_validate
662 (p_effective_date in date
663 ,p_rec in pqh_rer_shd.g_rec_type
664 ) is
665 --
666 l_proc varchar2(72) := g_package||'insert_validate';
667 --
668 Begin
669 hr_utility.set_location('Entering:'||l_proc, 5);
670 --
671 -- Call all supporting business operations
672 --
673 --
674 chk_startup_action(true
675 ,p_rec.business_group_id
676 ,p_rec.legislation_code
677 );
678 IF hr_startup_data_api_support.g_startup_mode
679 NOT IN ('GENERIC','STARTUP') THEN
680 --
681 -- Validate Important Attributes
682 --
683 hr_api.validate_bus_grp_id
684 (p_business_group_id => p_rec.business_group_id
685 ,p_associated_column1 => pqh_rer_shd.g_tab_nam
686 || '.BUSINESS_GROUP_ID');
687 --
688 -- after validating the set of important attributes,
689 -- if Multiple Message Detection is enabled and at least
690 -- one error has been found then abort further validation.
691 --
692 hr_multi_message.end_validation_set;
693 END IF;
694 --
695 --
696 -- Validate Dependent Attributes
697 --
698 --
699 chk_criteria_rate_element_id
700 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
701 p_criteria_rate_element_id => p_rec.criteria_rate_element_id,
702 p_object_version_number => p_rec.object_version_number);
703
704 chk_rel_element_type_id
705 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
706 p_rel_element_type_id => p_rec.rel_element_type_id,
707 p_object_version_number => p_rec.object_version_number);
708
709 if p_rec.rel_input_value_id IS NOT NULL THEN
710 chk_rel_input_value_id
711 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
712 p_rel_input_value_id => p_rec.rel_input_value_id,
713 p_object_version_number => p_rec.object_version_number);
714 end if;
715
716 if p_rec.business_group_id IS NOT NULL THEN
717 chk_business_group_id
718 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
719 p_business_group_id => p_rec.business_group_id ,
720 p_object_version_number => p_rec.object_version_number);
721 end if;
722
723 chk_relation_type_cd
724 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
725 p_relation_type_cd => p_rec.relation_type_cd,
726 p_effective_date => p_effective_date,
727 p_object_version_number => p_rec.object_version_number);
728
729
730
731 hr_utility.set_location(' Leaving:'||l_proc, 10);
732 End insert_validate;
733 --
734 -- ----------------------------------------------------------------------------
735 -- |---------------------------< update_validate >----------------------------|
736 -- ----------------------------------------------------------------------------
737 Procedure update_validate
738 (p_effective_date in date
739 ,p_rec in pqh_rer_shd.g_rec_type
740 ) is
741 --
742 l_proc varchar2(72) := g_package||'update_validate';
743 --
744 Begin
745 hr_utility.set_location('Entering:'||l_proc, 5);
746 --
747 -- Call all supporting business operations
748 --
749 --
750 chk_startup_action(false
751 ,p_rec.business_group_id
752 ,p_rec.legislation_code
753 );
754 IF hr_startup_data_api_support.g_startup_mode
755 NOT IN ('GENERIC','STARTUP') THEN
756 --
757 -- Validate Important Attributes
758 --
759 hr_api.validate_bus_grp_id
760 (p_business_group_id => p_rec.business_group_id
761 ,p_associated_column1 => pqh_rer_shd.g_tab_nam
762 || '.BUSINESS_GROUP_ID');
763 --
764 -- After validating the set of important attributes,
765 -- if Multiple Message Detection is enabled and at least
766 -- one error has been found then abort further validation.
767 --
768 hr_multi_message.end_validation_set;
769 END IF;
770 --
771 --
772 -- Validate Dependent Attributes
773 --
774 chk_criteria_rate_element_id
775 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
776 p_criteria_rate_element_id => p_rec.criteria_rate_element_id,
777 p_object_version_number => p_rec.object_version_number);
778
779 chk_rel_element_type_id
780 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
781 p_rel_element_type_id => p_rec.rel_element_type_id,
782 p_object_version_number => p_rec.object_version_number);
783
784 if p_rec.rel_input_value_id IS NOT NULL THEN
785 chk_rel_input_value_id
786 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
787 p_rel_input_value_id => p_rec.rel_input_value_id,
788 p_object_version_number => p_rec.object_version_number);
789 end if;
790
791 if p_rec.business_group_id IS NOT NULL THEN
792 chk_business_group_id
793 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
794 p_business_group_id => p_rec.business_group_id ,
795 p_object_version_number => p_rec.object_version_number);
796 end if;
797
798 chk_relation_type_cd
799 (p_rate_element_relation_id => p_rec.rate_element_relation_id,
800 p_relation_type_cd => p_rec.relation_type_cd,
801 p_effective_date => p_effective_date,
802 p_object_version_number => p_rec.object_version_number);
803
804
805 chk_non_updateable_args
806 (p_effective_date => p_effective_date
807 ,p_rec => p_rec
808 );
809 --
810 --
811 hr_utility.set_location(' Leaving:'||l_proc, 10);
812 End update_validate;
813 --
814 -- ----------------------------------------------------------------------------
815 -- |---------------------------< delete_validate >----------------------------|
816 -- ----------------------------------------------------------------------------
817 Procedure delete_validate
818 (p_rec in pqh_rer_shd.g_rec_type
819 ) is
820 --
821 l_proc varchar2(72) := g_package||'delete_validate';
822 --
823 Begin
824 hr_utility.set_location('Entering:'||l_proc, 5);
825 --
826 --
827 chk_startup_action(false
828 ,pqh_rer_shd.g_old_rec.business_group_id
829 ,pqh_rer_shd.g_old_rec.legislation_code
830 );
831 IF hr_startup_data_api_support.g_startup_mode
832 NOT IN ('GENERIC','STARTUP') THEN
833 --
834 -- Validate Important Attributes
835 --
836 --
837 -- After validating the set of important attributes,
838 -- if Multiple Message Detection is enabled and at least
839 -- one error has been found then abort further validation.
840 --
841 hr_multi_message.end_validation_set;
842 END IF;
843 --
844 -- Call all supporting business operations
845 --
846 hr_utility.set_location(' Leaving:'||l_proc, 10);
847 End delete_validate;
848 --
849 end pqh_rer_bus;