40: l_security_group_id number;
41: l_proc varchar2(72) := g_package||'set_security_group_id';
42: begin
43:
44: hr_utility.set_location('Entering:'|| l_proc, 10);
45: --
46: -- Ensure that all the mandatory parameter are not null
47: --
48: hr_api.mandatory_arg_error(p_api_name => l_proc,
58: (p_security_group_id => l_security_group_id
59: );
60:
61: --
62: hr_utility.set_location(' Leaving:'|| l_proc, 20);
63:
64: end set_security_group_id;
65: -- ----------------------------------------------------------------------------
66: -- |---------------------< chk_non_updateable_args >--------------------------|
71: --
72: l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
73: --
74: Begin
75: hr_utility.set_location('Entering:'||l_proc,10);
76: --
77: -- Only proceed with validation if a row exists for
78: -- the current record in the HR Schema
79: --
85: fnd_message.set_token('PROCEDURE',l_proc);
86: fnd_message.set_token('STEP',20);
87: fnd_message.raise_error;
88: end if;
89: hr_utility.set_location(l_proc,30);
90: --
91: if nvl(p_rec.name,hr_api.g_varchar2) <> hr_qsn_shd.g_old_rec.name then
92: hr_api.argument_changed_error
93: (p_api_name => l_proc
94: ,p_argument => 'NAME'
95: ,p_base_table => hr_qsn_shd.g_tab_nam
96: );
97: end if;
98: hr_utility.set_location(l_proc,40);
99: --
100: /**
101: if nvl(p_rec.text,hr_api.g_varchar2) <> hr_qsn_shd.g_old_rec.text then
102: hr_api.argument_changed_error
104: ,p_argument => 'TEXT'
105: ,p_base_table => hr_qsn_shd.g_tab_nam
106: );
107: end if;
108: hr_utility.set_location(l_proc,50);
109: --
110: if nvl(p_rec.business_group_id, hr_api.g_number) <>
111: hr_qsn_shd.g_old_rec.business_group_id then
112: hr_api.argument_changed_error
116: );
117: end if;
118: **/
119: --
120: hr_utility.set_location('Leaving: '|| l_proc,60);
121: --
122: end chk_non_updateable_args;
123: -- --------------------------------------------------------------------------
124: -- |------------------------< chk_name >------------------------------------|
142: and ((p_business_group_id is null and business_group_id is null)
143: or business_group_id = p_business_group_id);
144: --
145: begin
146: hr_utility.set_location('Entering: '||l_proc,10);
147: --
148: if p_name is not null then
149: -- Check that name is unique
150: open csr_unique_name;
160: fnd_message.set_name('PER','PER_52412_QSN_MAND_NAME');
161: fnd_message.raise_error;
162: end if;
163: --
164: hr_utility.set_location(' Leaving: '||l_proc, 50);
165: exception when app_exception.application_exception then
166: if hr_multi_message.exception_add
167: (p_associated_column1 => 'HR_QUESTIONNAIRES.NAME'
168: ) then
165: exception when app_exception.application_exception then
166: if hr_multi_message.exception_add
167: (p_associated_column1 => 'HR_QUESTIONNAIRES.NAME'
168: ) then
169: hr_utility.set_location(' Leaving:'|| l_proc, 60);
170: raise;
171: end if;
172: hr_utility.set_location(' Leaving:'|| l_proc, 70);
173: end chk_name;
168: ) then
169: hr_utility.set_location(' Leaving:'|| l_proc, 60);
170: raise;
171: end if;
172: hr_utility.set_location(' Leaving:'|| l_proc, 70);
173: end chk_name;
174: --
175: -- ---------------------------------------------------------------------------
176: -- |----------------------------< chk_text >---------------------------------|
185: l_proc varchar2(72) := g_package || 'chk_text';
186: --
187: begin
188: --
189: hr_utility.set_location('Entering: '||l_proc,10);
190: --
191: if p_text is not null then
192: -- Check the size of the text is less than max size
193: -- if Length(p_text) > c_max_size then
201: fnd_message.set_name('PER','PER_52413_QSN_MAND_TEXT');
202: fnd_message.raise_error;
203: end if;
204: --
205: hr_utility.set_location('Leaving: '||l_proc,50);
206: exception when app_exception.application_exception then
207: if hr_multi_message.exception_add
208: (p_associated_column1 => 'HR_QUESTIONNAIRES.TEXT'
209: ) then
206: exception when app_exception.application_exception then
207: if hr_multi_message.exception_add
208: (p_associated_column1 => 'HR_QUESTIONNAIRES.TEXT'
209: ) then
210: hr_utility.set_location(' Leaving:'|| l_proc, 60);
211: raise;
212: end if;
213: hr_utility.set_location(' Leaving:'|| l_proc, 70);
214:
209: ) then
210: hr_utility.set_location(' Leaving:'|| l_proc, 60);
211: raise;
212: end if;
213: hr_utility.set_location(' Leaving:'|| l_proc, 70);
214:
215: --
216: end chk_text;
217: --
231: l_api_updating boolean;
232: --
233: begin
234: --
235: hr_utility.set_location('Entering: '||l_proc,10);
236: --
237: l_api_updating := hr_qsn_shd.api_updating
238: (p_questionnaire_template_id => p_questionnaire_template_id
239: ,p_object_version_number => p_object_version_number);
236: --
237: l_api_updating := hr_qsn_shd.api_updating
238: (p_questionnaire_template_id => p_questionnaire_template_id
239: ,p_object_version_number => p_object_version_number);
240: hr_utility.set_location(l_proc,20);
241: --
242: if l_api_updating AND
243: (hr_qsn_shd.g_old_rec.available_flag
244: <> nvl(p_available_flag,hr_api.g_varchar2)) then
264: -- UPDATE and not changed - no need to validate
265: null;
266: end if;
267: --
268: hr_utility.set_location('Leaving: '||l_proc,50);
269: exception when app_exception.application_exception then
270: if hr_multi_message.exception_add
271: (p_associated_column1 => 'HR_QUESTIONNAIRES.AVAILABLE_FLAG'
272: ) then
269: exception when app_exception.application_exception then
270: if hr_multi_message.exception_add
271: (p_associated_column1 => 'HR_QUESTIONNAIRES.AVAILABLE_FLAG'
272: ) then
273: hr_utility.set_location(' Leaving:'|| l_proc, 60);
274: raise;
275: end if;
276: hr_utility.set_location(' Leaving:'|| l_proc, 70);
277: --
272: ) then
273: hr_utility.set_location(' Leaving:'|| l_proc, 60);
274: raise;
275: end if;
276: hr_utility.set_location(' Leaving:'|| l_proc, 70);
277: --
278: end chk_available_flag;
279: --
280: -- ----------------------------------------------------------------------------
295: where qsf.questionnaire_template_id = p_questionnaire_template_id;
296: --
297: begin
298: --
299: hr_utility.set_location('Entering: '||l_proc,10);
300: --
301: hr_api.mandatory_arg_error
302: (p_api_name => l_proc
303: ,p_argument => 'questionnaire_template_id'
313: fnd_message.raise_error;
314: end if;
315: close csr_chk_child_row;
316: --
317: hr_utility.set_location('Leaving: '||l_proc, 20);
318: exception when app_exception.application_exception then
319: if hr_multi_message.exception_add
320: (p_associated_column1 => 'HR_QUESTIONNAIRES.AVAILABLE_FLAG'
321: ) then
318: exception when app_exception.application_exception then
319: if hr_multi_message.exception_add
320: (p_associated_column1 => 'HR_QUESTIONNAIRES.AVAILABLE_FLAG'
321: ) then
322: hr_utility.set_location(' Leaving:'|| l_proc, 30);
323: raise;
324: end if;
325: hr_utility.set_location(' Leaving:'|| l_proc, 40);
326: --
321: ) then
322: hr_utility.set_location(' Leaving:'|| l_proc, 30);
323: raise;
324: end if;
325: hr_utility.set_location(' Leaving:'|| l_proc, 40);
326: --
327: end chk_row_delete;
328: -- ----------------------------------------------------------------------------
329: -- |---------------------------< insert_validate >----------------------------|
334: --
335: l_proc varchar2(72) := g_package||'insert_validate';
336: --
337: Begin
338: hr_utility.set_location('Entering:'||l_proc, 5);
339: --
340: -- Validate Important Attributes
341: --
342: if p_rec.business_group_id is not null then
360:
361: hr_multi_message.end_validation_set;
362:
363: --
364: hr_utility.set_location(' Leaving:'||l_proc, 10);
365: End insert_validate;
366: --
367: -- ----------------------------------------------------------------------------
368: -- |---------------------------< update_validate >----------------------------|
373: --
374: l_proc varchar2(72) := g_package||'update_validate';
375: --
376: Begin
377: hr_utility.set_location('Entering:'||l_proc, 5);
378: --
379: -- Call all supporting business operations
380: --
381: if p_rec.business_group_id is not null then
393: ,p_rec.questionnaire_template_id
394: ,p_rec.object_version_number
395: );
396: --
397: hr_utility.set_location(' Leaving:'||l_proc, 10);
398: End update_validate;
399: --
400: -- ----------------------------------------------------------------------------
401: -- |---------------------------< delete_validate >----------------------------|
404: --
405: l_proc varchar2(72) := g_package||'delete_validate';
406: --
407: Begin
408: hr_utility.set_location('Entering:'||l_proc, 5);
409: --
410: -- Call all supporting business operations
411: --
412: chk_row_delete(p_questionnaire_template_id => p_rec.questionnaire_template_id);
409: --
410: -- Call all supporting business operations
411: --
412: chk_row_delete(p_questionnaire_template_id => p_rec.questionnaire_template_id);
413: hr_utility.set_location(' Leaving:'||l_proc, 10);
414: End delete_validate;
415: --
416: -- ----------------------------------------------------------------------------
417: -- |--------------------< return_legislation_code >---------------------------|
433: --
434: l_legislation_code varchar2(150);
435: l_proc varchar2(72) := 'return_legislation_code';
436: begin
437: hr_utility.set_location('Entering: '||l_proc, 10);
438: hr_api.mandatory_arg_error(p_api_name => l_proc
439: ,p_argument => 'questionnaire_template_id'
440: ,p_argument_value => p_questionnaire_template_id
441: );
446: -- call to this function. Just return the value in the global
447: -- variable.
448: --
449: l_legislation_code := g_legislation_code;
450: hr_utility.set_location(l_proc,20);
451: else
452: --
453: -- The ID is different to the last call to this function
454: -- or this is the first call to this function.
462: close csr_leg_code;
463: fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
464: fnd_message.raise_error;
465: end if;
466: hr_utility.set_location(l_proc, 30);
467: --
468: -- Set the global variables so the values are
469: -- available for the next call to this function
470: --
471: close csr_leg_code;
472: g_questionnaire_template_id := p_questionnaire_template_id;
473: g_legislation_code := l_legislation_code;
474: end if;
475: hr_utility.set_location(' Leaving: '||l_proc, 40);
476: --
477: return l_legislation_code;
478: end return_legislation_code;
479: end hr_qsn_bus;