17: fetch val_temp_group_id into v_dummy;
18: if (val_temp_group_id%notfound) then
19: close val_temp_group_id;
20: fnd_message.set_name ('JTF', 'JTF_TASK_MISSING_TEMP_GRP');
21: fnd_msg_pub.add ;
22: raise fnd_api.g_exc_error;
23: else
24: close val_temp_group_id;
25: end if;
42: fetch val_name into v_dummy;
43: if (val_name%found) then
44: close val_name;
45: fnd_message.set_name ('JTF', 'JTF_TK_DUP_TEMPL_GRP_NAME');
46: fnd_msg_pub.add ;
47: raise fnd_api.g_exc_error;
48: else
49: close val_name;
50: end if;
70: fetch val_name_upd into v_dummy;
71: if (val_name_upd%found) then
72: close val_name_upd;
73: fnd_message.set_name ('JTF', 'JTF_TK_DUP_TEMPL_GRP_NAME');
74: fnd_msg_pub.add ;
75: raise fnd_api.g_exc_error;
76: else
77: close val_name_upd;
78: end if;
97: if (val_src%notfound) then
98: close val_src;
99: fnd_message.set_name ('JTF', 'JTF_TASK_INVALID_OBJECT_CODE');
100: fnd_message.set_token ('P_OBJECT_TYPE_CODE', 'Document Type:'||p_src_obj_typ);
101: fnd_msg_pub.add ;
102: raise fnd_api.g_exc_error;
103: else
104: close val_src;
105: end if;
114:
115: if (p_end < p_start) then
116: fnd_message.set_name ('JTF', 'JTF_TASK_INVALID_DATES');
117: fnd_message.set_token ('P_DATE_TAG', p_start);
118: fnd_msg_pub.add ;
119: raise fnd_api.g_exc_error;
120: end if;
121:
122: end if;
185: end if;
186:
187: -- initialize message list i p_init_msg_list is set to true
188: if (fnd_api.to_boolean(p_init_msg_list)) then
189: fnd_msg_pub.initialize;
190: end if;
191:
192: --check for required parameters
193: if (p_template_group_name is null) then
191:
192: --check for required parameters
193: if (p_template_group_name is null) then
194: fnd_message.set_name('JTF', 'JTF_TK_TMP_GRP_NAME_REQ');
195: fnd_msg_pub.add ;
196: raise fnd_api.g_exc_error;
197: end if;
198:
199: if (p_source_object_type_code is null) then
197: end if;
198:
199: if (p_source_object_type_code is null) then
200: fnd_message.set_name('JTF', 'JTF_TASK_MISSING_OBJECT_CODE');
201: fnd_msg_pub.add ;
202: raise fnd_api.g_exc_error;
203: end if;
204:
205: -- validate fields
246:
247: WHEN FND_API.G_EXC_ERROR THEN
248: ROLLBACK TO create_task_template_group;
249: x_return_status := FND_API.G_RET_STS_ERROR ;
250: FND_MSG_PUB.Count_And_Get
251: (p_count => x_msg_count ,
252: p_data => x_msg_data
253: );
254: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
253: );
254: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
255: ROLLBACK TO create_task_template_group;
256: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
257: FND_MSG_PUB.Count_And_Get
258: (p_count => x_msg_count ,
259: p_data => x_msg_data
260: );
261: WHEN OTHERS THEN
260: );
261: WHEN OTHERS THEN
262: ROLLBACK TO create_task_template_group;
263: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
264: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
265: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
266: END IF;
267: FND_MSG_PUB.Count_And_Get
268: (p_count => x_msg_count ,
261: WHEN OTHERS THEN
262: ROLLBACK TO create_task_template_group;
263: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
264: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
265: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
266: END IF;
267: FND_MSG_PUB.Count_And_Get
268: (p_count => x_msg_count ,
269: p_data => x_msg_data
263: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
264: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
265: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
266: END IF;
267: FND_MSG_PUB.Count_And_Get
268: (p_count => x_msg_count ,
269: p_data => x_msg_data
270: );
271:
300: END IF;
301:
302: IF fnd_api.to_boolean (p_init_msg_list)
303: THEN
304: fnd_msg_pub.initialize;
305: END IF;
306:
307: x_return_status := fnd_api.g_ret_sts_success;
308:
310: x_task_template_group_id => p_task_template_group_id ,
311: x_object_version_number => p_object_version_number );
312:
313:
314: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
315:
316: EXCEPTION
317: WHEN Resource_Locked then
318: ROLLBACK TO lock_task_template_group;
317: WHEN Resource_Locked then
318: ROLLBACK TO lock_task_template_group;
319: fnd_message.set_name ('JTF', 'JTF_TASK_RESOURCE_LOCKED');
320: fnd_message.set_token ('P_LOCKED_RESOURCE', 'Contacts');
321: fnd_msg_pub.add ;
322: x_return_status := fnd_api.g_ret_sts_unexp_error;
323: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
324:
325: WHEN fnd_api.g_exc_unexpected_error
319: fnd_message.set_name ('JTF', 'JTF_TASK_RESOURCE_LOCKED');
320: fnd_message.set_token ('P_LOCKED_RESOURCE', 'Contacts');
321: fnd_msg_pub.add ;
322: x_return_status := fnd_api.g_ret_sts_unexp_error;
323: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
324:
325: WHEN fnd_api.g_exc_unexpected_error
326: THEN
327: ROLLBACK TO lock_task_template_group;
325: WHEN fnd_api.g_exc_unexpected_error
326: THEN
327: ROLLBACK TO lock_task_template_group;
328: x_return_status := fnd_api.g_ret_sts_unexp_error;
329: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
330: WHEN OTHERS
331: THEN
332: ROLLBACK TO lock_task_template_group;
333: fnd_message.set_name ('JTF', 'JTF_TASK_UNKNOWN_ERROR');
331: THEN
332: ROLLBACK TO lock_task_template_group;
333: fnd_message.set_name ('JTF', 'JTF_TASK_UNKNOWN_ERROR');
334: fnd_message.set_token ('P_TEXT', SQLCODE || SQLERRM);
335: fnd_msg_pub.add ;
336: x_return_status := fnd_api.g_ret_sts_unexp_error;
337: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
338: END;
339:
333: fnd_message.set_name ('JTF', 'JTF_TASK_UNKNOWN_ERROR');
334: fnd_message.set_token ('P_TEXT', SQLCODE || SQLERRM);
335: fnd_msg_pub.add ;
336: x_return_status := fnd_api.g_ret_sts_unexp_error;
337: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
338: END;
339:
340:
341:
396: end if;
397:
398: -- initialize message list i p_init_msg_list is set to true
399: if (fnd_api.to_boolean(p_init_msg_list)) then
400: fnd_msg_pub.initialize;
401: end if;
402:
403: --check for required parameters
404: if (p_task_template_group_id is null) then
402:
403: --check for required parameters
404: if (p_task_template_group_id is null) then
405: fnd_message.set_name('JTF', 'JTF_TASK_MISSING_TEMP_GRP');
406: fnd_msg_pub.add ;
407: raise fnd_api.g_exc_error;
408: end if;
409:
410: if (p_template_group_name is null) then
408: end if;
409:
410: if (p_template_group_name is null) then
411: fnd_message.set_name('JTF', 'JTF_TK_TMP_GRP_NAME_REQ');
412: fnd_msg_pub.add ;
413: raise fnd_api.g_exc_error;
414: end if;
415:
416: if (p_source_object_type_code is null) then
414: end if;
415:
416: if (p_source_object_type_code is null) then
417: fnd_message.set_name('JTF', 'JTF_TASK_MISSING_OBJECT_CODE');
418: fnd_msg_pub.add ;
419: raise fnd_api.g_exc_error;
420: end if;
421:
422:
464:
465: WHEN FND_API.G_EXC_ERROR THEN
466: ROLLBACK TO update_task_template_group;
467: x_return_status := FND_API.G_RET_STS_ERROR ;
468: FND_MSG_PUB.Count_And_Get
469: (p_count => x_msg_count ,
470: p_data => x_msg_data
471: );
472: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
471: );
472: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
473: ROLLBACK TO update_task_template_group;
474: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
475: FND_MSG_PUB.Count_And_Get
476: (p_count => x_msg_count ,
477: p_data => x_msg_data
478: );
479: WHEN OTHERS THEN
479: WHEN OTHERS THEN
480:
481: ROLLBACK TO update_task_template_group;
482: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
483: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
484: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
485: END IF;
486: FND_MSG_PUB.Count_And_Get
487: (p_count => x_msg_count ,
480:
481: ROLLBACK TO update_task_template_group;
482: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
483: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
484: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
485: END IF;
486: FND_MSG_PUB.Count_And_Get
487: (p_count => x_msg_count ,
488: p_data => x_msg_data
482: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
483: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
484: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
485: END IF;
486: FND_MSG_PUB.Count_And_Get
487: (p_count => x_msg_count ,
488: p_data => x_msg_data
489: );
490:
536: end if;
537:
538: -- initialize message list i p_init_msg_list is set to true
539: if (fnd_api.to_boolean(p_init_msg_list)) then
540: fnd_msg_pub.initialize;
541: end if;
542:
543: --check for required parameters
544: if (p_task_template_group_id is null) then
542:
543: --check for required parameters
544: if (p_task_template_group_id is null) then
545: fnd_message.set_name('JTF', 'JTF_TASK_MISSING_TEMP_GRP');
546: fnd_msg_pub.add ;
547: raise fnd_api.g_exc_error;
548: end if;
549:
550: -- validate parameters
566: WHEN FND_API.G_EXC_ERROR THEN
567:
568: ROLLBACK TO delete_task_template_group;
569: x_return_status := FND_API.G_RET_STS_ERROR ;
570: FND_MSG_PUB.Count_And_Get
571: (p_count => x_msg_count ,
572: p_data => x_msg_data
573: );
574: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
574: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
575:
576: ROLLBACK TO delete_task_template_group;
577: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
578: FND_MSG_PUB.Count_And_Get
579: (p_count => x_msg_count ,
580: p_data => x_msg_data
581: );
582: WHEN OTHERS THEN
582: WHEN OTHERS THEN
583:
584: ROLLBACK TO delete_task_template_group;
585: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
586: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
587: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
588: END IF;
589: FND_MSG_PUB.Count_And_Get
590: (p_count => x_msg_count ,
583:
584: ROLLBACK TO delete_task_template_group;
585: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
586: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
587: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
588: END IF;
589: FND_MSG_PUB.Count_And_Get
590: (p_count => x_msg_count ,
591: p_data => x_msg_data
585: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
586: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
587: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
588: END IF;
589: FND_MSG_PUB.Count_And_Get
590: (p_count => x_msg_count ,
591: p_data => x_msg_data
592: );
593:
649: end if;
650:
651: -- initialize message list i p_init_msg_list is set to true
652: if (fnd_api.to_boolean(p_init_msg_list)) then
653: fnd_msg_pub.initialize;
654: end if;
655:
656: -- required parameters to control records returned
657:
657:
658: -- p_query_or_next_code should be Q or N
659: if (p_query_or_next_code not in ('Q', 'N')) or (p_query_or_next_code is null) then
660: fnd_message.set_name('JTF', 'JTF_TK_INV_QRY_NXT');
661: fnd_msg_pub.add ;
662: raise fnd_api.g_exc_error;
663: end if;
664:
665: -- dbms_output.put_line('1');
666:
667: -- p_show_all should be Y or N
668: if (p_show_all not in ('Y', 'N')) or (p_show_all is null) then
669: fnd_message.set_name('JTF', 'JTF_TK_INV_SHOW_ALL');
670: fnd_msg_pub.add ;
671: raise fnd_api.g_exc_error;
672: end if;
673: -- dbms_output.put_line('2');
674:
676:
677: if (p_start_pointer is null) then
678: -- dbms_output.put_line('3');
679: fnd_message.set_name('JTF', 'JTF_TK_NULL_STRT_PTR');
680: fnd_msg_pub.add ;
681: raise fnd_api.g_exc_error;
682: end if;
683:
684: if (p_rec_wanted is null) then
683:
684: if (p_rec_wanted is null) then
685: -- dbms_output.put_line('4');
686: fnd_message.set_name('JTF', 'JTF_TK_NULL_REC_WANT');
687: fnd_msg_pub.add ;
688: raise fnd_api.g_exc_error;
689: end if;
690:
691: end if;
725:
726: WHEN FND_API.G_EXC_ERROR THEN
727: ROLLBACK TO get_task_template_group;
728: x_return_status := FND_API.G_RET_STS_ERROR ;
729: FND_MSG_PUB.Count_And_Get
730: (p_count => x_msg_count ,
731: p_data => x_msg_data
732: );
733: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
733: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
734:
735: ROLLBACK TO get_task_template_group;
736: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
737: FND_MSG_PUB.Count_And_Get
738: (p_count => x_msg_count ,
739: p_data => x_msg_data
740: );
741: WHEN OTHERS THEN
740: );
741: WHEN OTHERS THEN
742: ROLLBACK TO get_task_template_group;
743: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
744: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
745: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
746: END IF;
747: FND_MSG_PUB.Count_And_Get
748: (p_count => x_msg_count ,
741: WHEN OTHERS THEN
742: ROLLBACK TO get_task_template_group;
743: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
744: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
745: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
746: END IF;
747: FND_MSG_PUB.Count_And_Get
748: (p_count => x_msg_count ,
749: p_data => x_msg_data
743: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
744: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
745: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME ,l_api_name);
746: END IF;
747: FND_MSG_PUB.Count_And_Get
748: (p_count => x_msg_count ,
749: p_data => x_msg_data
750: );
751: