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