50: SAVEPOINT Create_Esc_Note;
51:
52: -- Initialize API return status to success
53:
54: x_return_status := FND_API.G_RET_STS_SUCCESS;
55:
56: -------------------------------------------------------------------------------------------
57: -- Convert the missing fields to NULLs
58: -------------------------------------------------------------------------------------------
65: jtf_ec_util.Conv_Miss_Num(l_notes_rec.note_context_type_id_02);
66: jtf_ec_util.Conv_Miss_Char(l_notes_rec.note_context_type_03);
67: jtf_ec_util.Conv_Miss_Num(l_notes_rec.note_context_type_id_03);
68:
69: if l_notes_rec.note_status = fnd_api.g_miss_char then
70: l_notes_rec.note_status := 'I';
71: end if;
72:
73: if (l_notes_rec.note IS NOT NULL) then
73: if (l_notes_rec.note IS NOT NULL) then
74:
75: jtf_notes_pub.create_note(
76: p_api_version => l_api_version,
77: p_init_msg_list => fnd_api.g_false,
78: p_commit => fnd_api.g_false,
79: x_return_status => l_return_status,
80: x_msg_count => x_msg_count,
81: x_msg_data => x_msg_data,
74:
75: jtf_notes_pub.create_note(
76: p_api_version => l_api_version,
77: p_init_msg_list => fnd_api.g_false,
78: p_commit => fnd_api.g_false,
79: x_return_status => l_return_status,
80: x_msg_count => x_msg_count,
81: x_msg_data => x_msg_data,
82: p_source_object_id => p_source_object_id,
96: );
97:
98: x_note_id := l_note_id;
99:
100: if (l_return_status = fnd_api.g_ret_sts_error) then
101: raise fnd_api.g_exc_error;
102: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
103: raise fnd_api.g_exc_unexpected_error;
104: end if;
97:
98: x_note_id := l_note_id;
99:
100: if (l_return_status = fnd_api.g_ret_sts_error) then
101: raise fnd_api.g_exc_error;
102: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
103: raise fnd_api.g_exc_unexpected_error;
104: end if;
105:
98: x_note_id := l_note_id;
99:
100: if (l_return_status = fnd_api.g_ret_sts_error) then
101: raise fnd_api.g_exc_error;
102: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
103: raise fnd_api.g_exc_unexpected_error;
104: end if;
105:
106: end if;
99:
100: if (l_return_status = fnd_api.g_ret_sts_error) then
101: raise fnd_api.g_exc_error;
102: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
103: raise fnd_api.g_exc_unexpected_error;
104: end if;
105:
106: end if;
107:
121: p_last_update_login => l_login_id,
122: x_note_context_id => l_note_context_id
123: );
124:
125: if (l_return_status = fnd_api.g_ret_sts_error) then
126: raise fnd_api.g_exc_error;
127: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
128: raise fnd_api.g_exc_unexpected_error;
129: end if;
122: x_note_context_id => l_note_context_id
123: );
124:
125: if (l_return_status = fnd_api.g_ret_sts_error) then
126: raise fnd_api.g_exc_error;
127: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
128: raise fnd_api.g_exc_unexpected_error;
129: end if;
130:
123: );
124:
125: if (l_return_status = fnd_api.g_ret_sts_error) then
126: raise fnd_api.g_exc_error;
127: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
128: raise fnd_api.g_exc_unexpected_error;
129: end if;
130:
131: end if;
124:
125: if (l_return_status = fnd_api.g_ret_sts_error) then
126: raise fnd_api.g_exc_error;
127: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
128: raise fnd_api.g_exc_unexpected_error;
129: end if;
130:
131: end if;
132:
146: p_last_update_login => l_login_id,
147: x_note_context_id => l_note_context_id
148: );
149:
150: if (l_return_status = fnd_api.g_ret_sts_error) then
151: raise fnd_api.g_exc_error;
152: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
153: raise fnd_api.g_exc_unexpected_error;
154: end if;
147: x_note_context_id => l_note_context_id
148: );
149:
150: if (l_return_status = fnd_api.g_ret_sts_error) then
151: raise fnd_api.g_exc_error;
152: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
153: raise fnd_api.g_exc_unexpected_error;
154: end if;
155:
148: );
149:
150: if (l_return_status = fnd_api.g_ret_sts_error) then
151: raise fnd_api.g_exc_error;
152: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
153: raise fnd_api.g_exc_unexpected_error;
154: end if;
155:
156: end if;
149:
150: if (l_return_status = fnd_api.g_ret_sts_error) then
151: raise fnd_api.g_exc_error;
152: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
153: raise fnd_api.g_exc_unexpected_error;
154: end if;
155:
156: end if;
157:
171: p_last_update_login => l_login_id,
172: x_note_context_id => l_note_context_id
173: );
174:
175: if (l_return_status = fnd_api.g_ret_sts_error) then
176: raise fnd_api.g_exc_error;
177: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
178: raise fnd_api.g_exc_unexpected_error;
179: end if;
172: x_note_context_id => l_note_context_id
173: );
174:
175: if (l_return_status = fnd_api.g_ret_sts_error) then
176: raise fnd_api.g_exc_error;
177: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
178: raise fnd_api.g_exc_unexpected_error;
179: end if;
180:
173: );
174:
175: if (l_return_status = fnd_api.g_ret_sts_error) then
176: raise fnd_api.g_exc_error;
177: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
178: raise fnd_api.g_exc_unexpected_error;
179: end if;
180:
181: end if;
174:
175: if (l_return_status = fnd_api.g_ret_sts_error) then
176: raise fnd_api.g_exc_error;
177: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
178: raise fnd_api.g_exc_unexpected_error;
179: end if;
180:
181: end if;
182:
181: end if;
182:
183: EXCEPTION
184:
185: WHEN fnd_api.g_exc_error
186: THEN
187: ROLLBACK TO Create_Esc_Note;
188: x_return_status := fnd_api.g_ret_sts_error;
189: fnd_msg_pub.count_and_get (
184:
185: WHEN fnd_api.g_exc_error
186: THEN
187: ROLLBACK TO Create_Esc_Note;
188: x_return_status := fnd_api.g_ret_sts_error;
189: fnd_msg_pub.count_and_get (
190: p_count => x_msg_count,
191: p_data => x_msg_data
192: );
190: p_count => x_msg_count,
191: p_data => x_msg_data
192: );
193:
194: WHEN fnd_api.g_exc_unexpected_error
195: THEN
196:
197: ROLLBACK TO Create_Esc_Note;
198: x_return_status := fnd_api.g_ret_sts_unexp_error;
194: WHEN fnd_api.g_exc_unexpected_error
195: THEN
196:
197: ROLLBACK TO Create_Esc_Note;
198: x_return_status := fnd_api.g_ret_sts_unexp_error;
199: fnd_msg_pub.count_and_get (
200: p_count => x_msg_count,
201: p_data => x_msg_data
202: );
203:
204: WHEN OTHERS
205: THEN
206: ROLLBACK TO Create_Esc_Note;
207: x_return_status := fnd_api.g_ret_sts_unexp_error;
208:
209: if FND_MSG_PUB.Check_Msg_Level
210: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
211: then
241: SAVEPOINT Create_Esc_Contacts;
242:
243: -- Initialize API return status to success
244:
245: x_return_status := FND_API.G_RET_STS_SUCCESS;
246:
247: -------------------------------------------------------------------------------------------
248: -- Convert the missing fields to NULLs
249: -------------------------------------------------------------------------------------------
285: l_escalation_id) = FALSE then
286:
287: JTF_EC_CONTACTS_PVT.CREATE_ESCALATION_CONTACTS(
288: P_API_VERSION => l_api_version,
289: P_INIT_MSG_LIST => fnd_api.g_false,
290: P_COMMIT => fnd_api.g_false,
291: P_ESCALATION_ID => l_escalation_id,
292: P_ESCALATION_NUMBER => l_escalation_number,
293: P_CONTACT_ID => l_esc_contacts.contact_id,
286:
287: JTF_EC_CONTACTS_PVT.CREATE_ESCALATION_CONTACTS(
288: P_API_VERSION => l_api_version,
289: P_INIT_MSG_LIST => fnd_api.g_false,
290: P_COMMIT => fnd_api.g_false,
291: P_ESCALATION_ID => l_escalation_id,
292: P_ESCALATION_NUMBER => l_escalation_number,
293: P_CONTACT_ID => l_esc_contacts.contact_id,
294: P_CONTACT_TYPE_CODE => l_esc_contacts.contact_type_code,
315: p_attribute15 =>l_esc_contacts.attribute15,
316: p_attribute_category =>l_esc_contacts.attribute_category
317: );
318:
319: if (l_return_status = fnd_api.g_ret_sts_error) then
320: raise fnd_api.g_exc_error;
321: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
322: raise fnd_api.g_exc_unexpected_error;
323: end if;
316: p_attribute_category =>l_esc_contacts.attribute_category
317: );
318:
319: if (l_return_status = fnd_api.g_ret_sts_error) then
320: raise fnd_api.g_exc_error;
321: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
322: raise fnd_api.g_exc_unexpected_error;
323: end if;
324:
317: );
318:
319: if (l_return_status = fnd_api.g_ret_sts_error) then
320: raise fnd_api.g_exc_error;
321: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
322: raise fnd_api.g_exc_unexpected_error;
323: end if;
324:
325: else
318:
319: if (l_return_status = fnd_api.g_ret_sts_error) then
320: raise fnd_api.g_exc_error;
321: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
322: raise fnd_api.g_exc_unexpected_error;
323: end if;
324:
325: else
326:
327: fnd_message.set_name('JTF', 'JTF_API_ALL_DUPLICATE_VALUE');
328: fnd_message.set_token('API_NAME', l_api_name);
329: fnd_message.set_token('DUPLICATE_VAL_PARAM', 'Contact ID: ' || to_char(l_esc_contacts.contact_id));
330: fnd_msg_pub.add;
331: raise fnd_api.g_exc_error;
332:
333: end if;
334:
335: EXCEPTION
333: end if;
334:
335: EXCEPTION
336:
337: WHEN fnd_api.g_exc_error
338: THEN
339: ROLLBACK TO Create_Esc_Contacts;
340: x_return_status := fnd_api.g_ret_sts_error;
341: fnd_msg_pub.count_and_get (
336:
337: WHEN fnd_api.g_exc_error
338: THEN
339: ROLLBACK TO Create_Esc_Contacts;
340: x_return_status := fnd_api.g_ret_sts_error;
341: fnd_msg_pub.count_and_get (
342: p_count => x_msg_count,
343: p_data => x_msg_data
344: );
342: p_count => x_msg_count,
343: p_data => x_msg_data
344: );
345:
346: WHEN fnd_api.g_exc_unexpected_error
347: THEN
348:
349: ROLLBACK TO Create_Esc_Contacts;
350: x_return_status := fnd_api.g_ret_sts_unexp_error;
346: WHEN fnd_api.g_exc_unexpected_error
347: THEN
348:
349: ROLLBACK TO Create_Esc_Contacts;
350: x_return_status := fnd_api.g_ret_sts_unexp_error;
351: fnd_msg_pub.count_and_get (
352: p_count => x_msg_count,
353: p_data => x_msg_data
354: );
355:
356: WHEN OTHERS
357: THEN
358: ROLLBACK TO Create_Esc_Contacts;
359: x_return_status := fnd_api.g_ret_sts_unexp_error;
360: if FND_MSG_PUB.Check_Msg_Level
361: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
362: then
363: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, l_api_name);
392: SAVEPOINT Create_Esc_Reference;
393:
394: -- Initialize API return status to success
395:
396: x_return_status := FND_API.G_RET_STS_SUCCESS;
397:
398: l_return_status := 'x';
399:
400: jtf_ec_util.Conv_Miss_Char(l_reference_documents.object_type_code);
425: if jtf_ec_util.Validate_Lookup('JTF_TASK_REFERENCE_CODES',
426: l_reference_documents.reference_code) = FALSE
427: then
428: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, l_reference_documents.reference_code, 'reference_code');
429: raise fnd_api.g_exc_error;
430: end if;
431:
432: -- check whether the same document is passed twice. If yes - skip it;
433:
447: fnd_message.set_name ('JTF', 'JTF_TK_ESC_DOC_EXIST');
448: fnd_message.set_token('OBJECT_TYPE',l_reference_documents.object_type_code);
449: fnd_message.set_token('OBJECT_NUMBER',l_reference_documents.object_name);
450: fnd_msg_pub.Add;
451: raise fnd_api.g_exc_error;
452: end if;
453: end if;
454:
455: JTF_EC_REFERENCES_PVT.CREATE_REFERENCES(
453: end if;
454:
455: JTF_EC_REFERENCES_PVT.CREATE_REFERENCES(
456: P_API_VERSION => 1.0,
457: P_INIT_MSG_LIST => fnd_api.g_true,
458: P_COMMIT => fnd_api.g_false,
459: P_ESCALATION_ID => l_escalation_id,
460: P_ESCALATION_NUMBER => l_escalation_number,
461: P_OBJECT_TYPE_CODE => l_reference_documents.object_type_code,
454:
455: JTF_EC_REFERENCES_PVT.CREATE_REFERENCES(
456: P_API_VERSION => 1.0,
457: P_INIT_MSG_LIST => fnd_api.g_true,
458: P_COMMIT => fnd_api.g_false,
459: P_ESCALATION_ID => l_escalation_id,
460: P_ESCALATION_NUMBER => l_escalation_number,
461: P_OBJECT_TYPE_CODE => l_reference_documents.object_type_code,
462: P_OBJECT_NAME => l_reference_documents.object_name,
484: p_attribute14 => l_reference_documents.attribute14,
485: p_attribute15 => l_reference_documents.attribute15,
486: p_attribute_category => l_reference_documents.attribute_category);
487:
488: if (l_return_status = fnd_api.g_ret_sts_error) then
489: raise fnd_api.g_exc_error;
490: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
491: raise fnd_api.g_exc_unexpected_error;
492: end if;
485: p_attribute15 => l_reference_documents.attribute15,
486: p_attribute_category => l_reference_documents.attribute_category);
487:
488: if (l_return_status = fnd_api.g_ret_sts_error) then
489: raise fnd_api.g_exc_error;
490: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
491: raise fnd_api.g_exc_unexpected_error;
492: end if;
493: end if;
486: p_attribute_category => l_reference_documents.attribute_category);
487:
488: if (l_return_status = fnd_api.g_ret_sts_error) then
489: raise fnd_api.g_exc_error;
490: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
491: raise fnd_api.g_exc_unexpected_error;
492: end if;
493: end if;
494: else
487:
488: if (l_return_status = fnd_api.g_ret_sts_error) then
489: raise fnd_api.g_exc_error;
490: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
491: raise fnd_api.g_exc_unexpected_error;
492: end if;
493: end if;
494: else
495:
497:
498: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL', 'object_id');
499: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL', 'object_name');
500: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL', 'object_type_code');
501: raise fnd_api.g_exc_error;
502:
503: end if;
504:
505: EXCEPTION
503: end if;
504:
505: EXCEPTION
506:
507: WHEN fnd_api.g_exc_error
508: THEN
509: ROLLBACK TO Create_Esc_Reference;
510: x_return_status := fnd_api.g_ret_sts_error;
511: fnd_msg_pub.count_and_get (
506:
507: WHEN fnd_api.g_exc_error
508: THEN
509: ROLLBACK TO Create_Esc_Reference;
510: x_return_status := fnd_api.g_ret_sts_error;
511: fnd_msg_pub.count_and_get (
512: p_count => x_msg_count,
513: p_data => x_msg_data
514: );
512: p_count => x_msg_count,
513: p_data => x_msg_data
514: );
515:
516: WHEN fnd_api.g_exc_unexpected_error
517: THEN
518:
519: ROLLBACK TO Create_Esc_Reference;
520: x_return_status := fnd_api.g_ret_sts_unexp_error;
516: WHEN fnd_api.g_exc_unexpected_error
517: THEN
518:
519: ROLLBACK TO Create_Esc_Reference;
520: x_return_status := fnd_api.g_ret_sts_unexp_error;
521: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
522: p_data => x_msg_data);
523:
524: WHEN OTHERS
523:
524: WHEN OTHERS
525: THEN
526: ROLLBACK TO Create_Esc_Reference;
527: x_return_status := fnd_api.g_ret_sts_unexp_error;
528:
529: if FND_MSG_PUB.Check_Msg_Level
530: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
531: then
537: END Create_Esc_Reference;
538:
539: PROCEDURE CREATE_ESCALATION (
540: p_api_version IN NUMBER,
541: p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
542: p_commit IN VARCHAR2 DEFAULT fnd_api.g_false,
543: x_return_status OUT NOCOPY VARCHAR2,
544: x_msg_count OUT NOCOPY NUMBER,
545: x_msg_data OUT NOCOPY VARCHAR2,
538:
539: PROCEDURE CREATE_ESCALATION (
540: p_api_version IN NUMBER,
541: p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
542: p_commit IN VARCHAR2 DEFAULT fnd_api.g_false,
543: x_return_status OUT NOCOPY VARCHAR2,
544: x_msg_count OUT NOCOPY NUMBER,
545: x_msg_data OUT NOCOPY VARCHAR2,
546: p_resp_appl_id IN NUMBER,
601: SAVEPOINT Create_Escalation;
602:
603: -- Standard call to check for call compatibility.
604:
605: IF NOT FND_API.Compatible_API_Call ( l_api_version,
606: p_api_version,
607: l_api_name,
608: G_PKG_NAME)
609: THEN
606: p_api_version,
607: l_api_name,
608: G_PKG_NAME)
609: THEN
610: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
611: END IF;
612:
613: -- Check p_init_msg_list
614:
611: END IF;
612:
613: -- Check p_init_msg_list
614:
615: IF FND_API.To_Boolean( p_init_msg_list ) THEN
616: FND_MSG_PUB.initialize;
617: END IF;
618:
619: -- Initialize API return status to success
617: END IF;
618:
619: -- Initialize API return status to success
620:
621: x_return_status := FND_API.G_RET_STS_SUCCESS;
622:
623: ----------------------------------------------------------------------------------------------------
624: -- standard customer user hook pre-processing
625: ----------------------------------------------------------------------------------------------------
634: x_return_status => l_return_status,
635: x_msg_count => x_msg_count,
636: x_msg_data => x_msg_data);
637:
638: if l_return_status = fnd_api.g_ret_sts_error then
639: raise fnd_api.g_exc_error;
640: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
641: raise fnd_api.g_exc_unexpected_error;
642: end if;
635: x_msg_count => x_msg_count,
636: x_msg_data => x_msg_data);
637:
638: if l_return_status = fnd_api.g_ret_sts_error then
639: raise fnd_api.g_exc_error;
640: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
641: raise fnd_api.g_exc_unexpected_error;
642: end if;
643:
636: x_msg_data => x_msg_data);
637:
638: if l_return_status = fnd_api.g_ret_sts_error then
639: raise fnd_api.g_exc_error;
640: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
641: raise fnd_api.g_exc_unexpected_error;
642: end if;
643:
644: end if;
637:
638: if l_return_status = fnd_api.g_ret_sts_error then
639: raise fnd_api.g_exc_error;
640: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
641: raise fnd_api.g_exc_unexpected_error;
642: end if;
643:
644: end if;
645: ----------------------------------------------------------------------------------------------------
656: x_return_status => l_return_status,
657: x_msg_count => x_msg_count,
658: x_msg_data => x_msg_data);
659:
660: if l_return_status = fnd_api.g_ret_sts_error then
661: raise fnd_api.g_exc_error;
662: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
663: raise fnd_api.g_exc_unexpected_error;
664: end if;
657: x_msg_count => x_msg_count,
658: x_msg_data => x_msg_data);
659:
660: if l_return_status = fnd_api.g_ret_sts_error then
661: raise fnd_api.g_exc_error;
662: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
663: raise fnd_api.g_exc_unexpected_error;
664: end if;
665:
658: x_msg_data => x_msg_data);
659:
660: if l_return_status = fnd_api.g_ret_sts_error then
661: raise fnd_api.g_exc_error;
662: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
663: raise fnd_api.g_exc_unexpected_error;
664: end if;
665:
666: end if;
659:
660: if l_return_status = fnd_api.g_ret_sts_error then
661: raise fnd_api.g_exc_error;
662: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
663: raise fnd_api.g_exc_unexpected_error;
664: end if;
665:
666: end if;
667:
673:
674: if l_user_id is NOT NULL then
675: jtf_ec_util.Validate_Who_Info( l_api_name, l_user_id,
676: l_login_id, l_return_status);
677: if (l_return_status = fnd_api.g_ret_sts_error) then
678: raise fnd_api.g_exc_error;
679: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
680: raise fnd_api.g_exc_unexpected_error;
681: end if;
674: if l_user_id is NOT NULL then
675: jtf_ec_util.Validate_Who_Info( l_api_name, l_user_id,
676: l_login_id, l_return_status);
677: if (l_return_status = fnd_api.g_ret_sts_error) then
678: raise fnd_api.g_exc_error;
679: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
680: raise fnd_api.g_exc_unexpected_error;
681: end if;
682: else
675: jtf_ec_util.Validate_Who_Info( l_api_name, l_user_id,
676: l_login_id, l_return_status);
677: if (l_return_status = fnd_api.g_ret_sts_error) then
678: raise fnd_api.g_exc_error;
679: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
680: raise fnd_api.g_exc_unexpected_error;
681: end if;
682: else
683: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
676: l_login_id, l_return_status);
677: if (l_return_status = fnd_api.g_ret_sts_error) then
678: raise fnd_api.g_exc_error;
679: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
680: raise fnd_api.g_exc_unexpected_error;
681: end if;
682: else
683: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
684: raise fnd_api.g_exc_error;
680: raise fnd_api.g_exc_unexpected_error;
681: end if;
682: else
683: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
684: raise fnd_api.g_exc_error;
685: end if;
686:
687: if l_esc_record.esc_name is NULL or l_esc_record.esc_name = fnd_api.g_miss_char then
688: l_esc_record.esc_name := g_escalation_name;
683: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
684: raise fnd_api.g_exc_error;
685: end if;
686:
687: if l_esc_record.esc_name is NULL or l_esc_record.esc_name = fnd_api.g_miss_char then
688: l_esc_record.esc_name := g_escalation_name;
689: end if;
690:
691: if l_esc_record.esc_open_date is NULL or l_esc_record.esc_open_date = fnd_api.g_miss_date then
687: if l_esc_record.esc_name is NULL or l_esc_record.esc_name = fnd_api.g_miss_char then
688: l_esc_record.esc_name := g_escalation_name;
689: end if;
690:
691: if l_esc_record.esc_open_date is NULL or l_esc_record.esc_open_date = fnd_api.g_miss_date then
692: l_esc_record.esc_open_date := sysdate;
693: end if;
694:
695: -------------------------------------------------------------------------
698: -------------------------------------------------------------------------
699:
700: l_return_status := 'x';
701:
702: if l_esc_record.esc_owner_id is NULL or l_esc_record.esc_owner_id = fnd_api.g_miss_num then
703: l_esc_record.esc_owner_id := FND_PROFILE.Value_Specific('JTF_EC_DEFAULT_OWNER',
704: l_user_id, l_resp_id, l_resp_appl_id);
705: end if;
706:
706:
707: --Bug 2723761
708: --jtf_ec_util.validate_owner(l_esc_record.esc_owner_id, g_escalation_owner_type_code, l_return_status);
709: if l_esc_record.esc_owner_type_code is NULL OR
710: l_esc_record.esc_owner_type_code = fnd_api.g_miss_char then
711: l_esc_record.esc_owner_type_code := g_escalation_owner_type_code;
712: end if;
713:
714: jtf_ec_util.validate_owner( l_esc_record.esc_owner_id,
713:
714: jtf_ec_util.validate_owner( l_esc_record.esc_owner_id,
715: l_esc_record.esc_owner_type_code,
716: l_return_status);
717: if l_return_status <> fnd_api.g_ret_sts_success then
718: raise fnd_api.g_exc_error;
719: end if;
720:
721: -------------------------------------------------------------------------
714: jtf_ec_util.validate_owner( l_esc_record.esc_owner_id,
715: l_esc_record.esc_owner_type_code,
716: l_return_status);
717: if l_return_status <> fnd_api.g_ret_sts_success then
718: raise fnd_api.g_exc_error;
719: end if;
720:
721: -------------------------------------------------------------------------
722: -- validate status
722: -- validate status
723: -- if the status is not passed it will be defaulted from a profile option
724: -------------------------------------------------------------------------
725:
726: if (l_esc_record.status_id = fnd_api.g_miss_num or l_esc_record.status_id is NULL)
727: and (l_esc_record.status_name = fnd_api.g_miss_char or l_esc_record.status_name is NULL)
728: then
729: l_esc_record.status_id := FND_PROFILE.Value_Specific('JTF_EC_DEFAULT_STATUS',
730: l_user_id, l_resp_id, l_resp_appl_id);
723: -- if the status is not passed it will be defaulted from a profile option
724: -------------------------------------------------------------------------
725:
726: if (l_esc_record.status_id = fnd_api.g_miss_num or l_esc_record.status_id is NULL)
727: and (l_esc_record.status_name = fnd_api.g_miss_char or l_esc_record.status_name is NULL)
728: then
729: l_esc_record.status_id := FND_PROFILE.Value_Specific('JTF_EC_DEFAULT_STATUS',
730: l_user_id, l_resp_id, l_resp_appl_id);
731: end if;
736: p_esc_status_name => l_esc_record.status_name,
737: x_return_status => l_return_status,
738: x_esc_status_id => l_esc_status_id);
739:
740: if l_return_status <> fnd_api.g_ret_sts_success then
741: raise fnd_api.g_exc_error;
742: end if;
743:
744: -------------------------------------------------------------------------
737: x_return_status => l_return_status,
738: x_esc_status_id => l_esc_status_id);
739:
740: if l_return_status <> fnd_api.g_ret_sts_success then
741: raise fnd_api.g_exc_error;
742: end if;
743:
744: -------------------------------------------------------------------------
745: -- validate escalation reason
745: -- validate escalation reason
746: -- if the reason code is not passed it will be defaulted from a profile option
747: -------------------------------------------------------------------------
748:
749: if (l_esc_record.reason_code = fnd_api.g_miss_char or l_esc_record.reason_code is NULL)
750: then
751: l_esc_record.reason_code := FND_PROFILE.Value_Specific('JTF_EC_DEFAULT_REASON_CODE',
752: l_user_id,
753: l_resp_id,
757: if jtf_ec_util.Validate_Lookup('JTF_TASK_REASON_CODES',
758: l_esc_record.reason_code) = FALSE
759: then
760: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, l_esc_record.reason_code, 'reason_code');
761: raise fnd_api.g_exc_error;
762: end if;
763:
764: -------------------------------------------------------------------------
765: -- validate escalation level
765: -- validate escalation level
766: -- if the level is not passed it will be defaulted from a profile option
767: -------------------------------------------------------------------------
768:
769: if (l_esc_record.escalation_level = fnd_api.g_miss_char or l_esc_record.escalation_level is NULL)
770: then
771: l_esc_record.escalation_level := FND_PROFILE.Value_Specific('JTF_EC_DEFAULT_ESCALATION_LEVEL',
772: l_user_id, l_resp_id,
773: l_resp_appl_id);
776: if jtf_ec_util.Validate_Lookup('JTF_TASK_ESC_LEVEL',
777: l_esc_record.escalation_level ) = FALSE
778: then
779: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, l_esc_record.escalation_level, 'escalation_level');
780: raise fnd_api.g_exc_error;
781: end if;
782:
783: -------------------------------------------------------------------------
784: -- Create escalation header
823:
824: -- Bug 2650521
825: JTF_EC_PVT.CREATE_ESCALATION (
826: P_API_VERSION => l_api_version,
827: P_INIT_MSG_LIST => fnd_api.g_false,
828: P_COMMIT => fnd_api.g_false,
829: p_esc_id => l_escalation_id,
830: P_ESCALATION_NAME => l_esc_record.esc_name,
831: P_DESCRIPTION => l_esc_record.esc_description,
824: -- Bug 2650521
825: JTF_EC_PVT.CREATE_ESCALATION (
826: P_API_VERSION => l_api_version,
827: P_INIT_MSG_LIST => fnd_api.g_false,
828: P_COMMIT => fnd_api.g_false,
829: p_esc_id => l_escalation_id,
830: P_ESCALATION_NAME => l_esc_record.esc_name,
831: P_DESCRIPTION => l_esc_record.esc_description,
832: P_ESCALATION_STATUS_NAME => l_esc_record.status_name,
873: p_attribute15 =>l_esc_record.attribute15,
874: p_attribute_category =>l_esc_record.attribute_category
875: );
876:
877: if (l_return_status = fnd_api.g_ret_sts_error) then
878: raise fnd_api.g_exc_error;
879: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
880: raise fnd_api.g_exc_unexpected_error;
881: end if;
874: p_attribute_category =>l_esc_record.attribute_category
875: );
876:
877: if (l_return_status = fnd_api.g_ret_sts_error) then
878: raise fnd_api.g_exc_error;
879: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
880: raise fnd_api.g_exc_unexpected_error;
881: end if;
882:
875: );
876:
877: if (l_return_status = fnd_api.g_ret_sts_error) then
878: raise fnd_api.g_exc_error;
879: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
880: raise fnd_api.g_exc_unexpected_error;
881: end if;
882:
883: open task_number(l_escalation_id);
876:
877: if (l_return_status = fnd_api.g_ret_sts_error) then
878: raise fnd_api.g_exc_error;
879: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
880: raise fnd_api.g_exc_unexpected_error;
881: end if;
882:
883: open task_number(l_escalation_id);
884: fetch task_number into l_escalation_number;
883: open task_number(l_escalation_id);
884: fetch task_number into l_escalation_number;
885: if task_number%NOTFOUND then
886: close task_number;
887: RAISE fnd_api.g_exc_unexpected_error;
888: end if;
889: close task_number;
890:
891: for j in 1..l_esc_contacts.COUNT loop
902: x_msg_data => x_msg_data,
903: x_esc_contact_id => l_escalation_contact_id,
904: x_return_status => l_return_status);
905:
906: if (l_return_status = fnd_api.g_ret_sts_error) then
907: raise fnd_api.g_exc_error;
908: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
909: raise fnd_api.g_exc_unexpected_error;
910: end if;
903: x_esc_contact_id => l_escalation_contact_id,
904: x_return_status => l_return_status);
905:
906: if (l_return_status = fnd_api.g_ret_sts_error) then
907: raise fnd_api.g_exc_error;
908: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
909: raise fnd_api.g_exc_unexpected_error;
910: end if;
911:
904: x_return_status => l_return_status);
905:
906: if (l_return_status = fnd_api.g_ret_sts_error) then
907: raise fnd_api.g_exc_error;
908: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
909: raise fnd_api.g_exc_unexpected_error;
910: end if;
911:
912: end if;
905:
906: if (l_return_status = fnd_api.g_ret_sts_error) then
907: raise fnd_api.g_exc_error;
908: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
909: raise fnd_api.g_exc_unexpected_error;
910: end if;
911:
912: end if;
913:
920: l_return_status := 'x';
921:
922: jtf_ec_util.Validate_Requester(l_escalation_id, l_return_status);
923:
924: if l_return_status <> fnd_api.g_ret_sts_success then
925: raise fnd_api.g_exc_error;
926: end if;
927:
928: -------------------------------------------------------------------------
921:
922: jtf_ec_util.Validate_Requester(l_escalation_id, l_return_status);
923:
924: if l_return_status <> fnd_api.g_ret_sts_success then
925: raise fnd_api.g_exc_error;
926: end if;
927:
928: -------------------------------------------------------------------------
929: -- ** Insert the contact points
942: l_escalation_id,
943: l_escalation_contact_id,
944: l_return_status);
945:
946: if (l_return_status = fnd_api.g_ret_sts_error) then
947: raise fnd_api.g_exc_error;
948: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
949: raise fnd_api.g_exc_unexpected_error;
950: end if;
943: l_escalation_contact_id,
944: l_return_status);
945:
946: if (l_return_status = fnd_api.g_ret_sts_error) then
947: raise fnd_api.g_exc_error;
948: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
949: raise fnd_api.g_exc_unexpected_error;
950: end if;
951:
944: l_return_status);
945:
946: if (l_return_status = fnd_api.g_ret_sts_error) then
947: raise fnd_api.g_exc_error;
948: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
949: raise fnd_api.g_exc_unexpected_error;
950: end if;
951:
952: jtf_ec_util.Conv_Miss_Char(l_cont_points(j).attribute1);
945:
946: if (l_return_status = fnd_api.g_ret_sts_error) then
947: raise fnd_api.g_exc_error;
948: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
949: raise fnd_api.g_exc_unexpected_error;
950: end if;
951:
952: jtf_ec_util.Conv_Miss_Char(l_cont_points(j).attribute1);
953: jtf_ec_util.Conv_Miss_Char(l_cont_points(j).attribute2);
969: -- insert the phone_id (contact_point) for this contact
970:
971: Jtf_Task_Phones_Pub.create_task_phones (
972: p_api_version => l_api_version,
973: p_init_msg_list => fnd_api.g_false,
974: p_commit => fnd_api.g_false,
975: p_task_contact_id => l_escalation_contact_id,
976: p_phone_id => l_cont_points(j).contact_point_id,
977: x_task_phone_id => l_task_phone_id,
970:
971: Jtf_Task_Phones_Pub.create_task_phones (
972: p_api_version => l_api_version,
973: p_init_msg_list => fnd_api.g_false,
974: p_commit => fnd_api.g_false,
975: p_task_contact_id => l_escalation_contact_id,
976: p_phone_id => l_cont_points(j).contact_point_id,
977: x_task_phone_id => l_task_phone_id,
978: x_return_status => l_return_status,
995: p_attribute15 => l_cont_points(j).attribute15,
996: p_attribute_category => l_cont_points(j).attribute_category
997: );
998:
999: if (l_return_status = fnd_api.g_ret_sts_error) then
1000: raise fnd_api.g_exc_error;
1001: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1002: raise fnd_api.g_exc_unexpected_error;
1003: end if;
996: p_attribute_category => l_cont_points(j).attribute_category
997: );
998:
999: if (l_return_status = fnd_api.g_ret_sts_error) then
1000: raise fnd_api.g_exc_error;
1001: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1002: raise fnd_api.g_exc_unexpected_error;
1003: end if;
1004:
997: );
998:
999: if (l_return_status = fnd_api.g_ret_sts_error) then
1000: raise fnd_api.g_exc_error;
1001: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1002: raise fnd_api.g_exc_unexpected_error;
1003: end if;
1004:
1005: end if;
998:
999: if (l_return_status = fnd_api.g_ret_sts_error) then
1000: raise fnd_api.g_exc_error;
1001: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1002: raise fnd_api.g_exc_unexpected_error;
1003: end if;
1004:
1005: end if;
1006:
1018: ----------------------------------------------------------------------------------
1019:
1020: if l_reference_documents(j).action_code = 'I' then
1021:
1022: if (l_reference_documents(j).reference_code = fnd_api.g_miss_char
1023: OR l_reference_documents(j).reference_code is NULL)
1024: then
1025: l_reference_documents(j).reference_code := FND_PROFILE.Value_Specific('JTF_EC_DEFAULT_REF_TYPE',
1026: l_user_id, l_resp_id, l_resp_appl_id);
1033: x_msg_data,
1034: l_escalation_reference_id,
1035: l_return_status);
1036:
1037: if (l_return_status = fnd_api.g_ret_sts_error) then
1038: raise fnd_api.g_exc_error;
1039: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1040: raise fnd_api.g_exc_unexpected_error;
1041: end if;
1034: l_escalation_reference_id,
1035: l_return_status);
1036:
1037: if (l_return_status = fnd_api.g_ret_sts_error) then
1038: raise fnd_api.g_exc_error;
1039: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1040: raise fnd_api.g_exc_unexpected_error;
1041: end if;
1042:
1035: l_return_status);
1036:
1037: if (l_return_status = fnd_api.g_ret_sts_error) then
1038: raise fnd_api.g_exc_error;
1039: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1040: raise fnd_api.g_exc_unexpected_error;
1041: end if;
1042:
1043: end if;
1036:
1037: if (l_return_status = fnd_api.g_ret_sts_error) then
1038: raise fnd_api.g_exc_error;
1039: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1040: raise fnd_api.g_exc_unexpected_error;
1041: end if;
1042:
1043: end if;
1044:
1061: x_msg_data,
1062: l_note_id,
1063: l_return_status);
1064:
1065: if (l_return_status = fnd_api.g_ret_sts_error) then
1066: raise fnd_api.g_exc_error;
1067: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1068: raise fnd_api.g_exc_unexpected_error;
1069: end if;
1062: l_note_id,
1063: l_return_status);
1064:
1065: if (l_return_status = fnd_api.g_ret_sts_error) then
1066: raise fnd_api.g_exc_error;
1067: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1068: raise fnd_api.g_exc_unexpected_error;
1069: end if;
1070:
1063: l_return_status);
1064:
1065: if (l_return_status = fnd_api.g_ret_sts_error) then
1066: raise fnd_api.g_exc_error;
1067: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1068: raise fnd_api.g_exc_unexpected_error;
1069: end if;
1070:
1071: end loop;
1064:
1065: if (l_return_status = fnd_api.g_ret_sts_error) then
1066: raise fnd_api.g_exc_error;
1067: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1068: raise fnd_api.g_exc_unexpected_error;
1069: end if;
1070:
1071: end loop;
1072:
1075: -------------------------------------------------------------------------------------
1076:
1077: JTF_EC_WORKFLOW_PKG.Start_Resc_Workflow(
1078: P_API_VERSION =>l_api_version,
1079: P_INIT_MSG_LIST =>fnd_api.g_false,
1080: P_COMMIT =>fnd_api.g_false,
1081: X_RETURN_STATUS =>l_return_status,
1082: X_MSG_COUNT =>x_msg_count,
1083: X_MSG_DATA =>x_msg_data,
1076:
1077: JTF_EC_WORKFLOW_PKG.Start_Resc_Workflow(
1078: P_API_VERSION =>l_api_version,
1079: P_INIT_MSG_LIST =>fnd_api.g_false,
1080: P_COMMIT =>fnd_api.g_false,
1081: X_RETURN_STATUS =>l_return_status,
1082: X_MSG_COUNT =>x_msg_count,
1083: X_MSG_DATA =>x_msg_data,
1084: P_TASK_ID =>l_escalation_id,
1085: P_DOC_CREATED =>'Y',
1086: x_notif_not_sent => l_notif_not_sent,
1087: X_WF_PROCESS_ID =>l_wf_process_id);
1088:
1089: if (l_return_status = fnd_api.g_ret_sts_error) then
1090: raise fnd_api.g_exc_error;
1091: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1092: raise fnd_api.g_exc_unexpected_error;
1093: end if;
1086: x_notif_not_sent => l_notif_not_sent,
1087: X_WF_PROCESS_ID =>l_wf_process_id);
1088:
1089: if (l_return_status = fnd_api.g_ret_sts_error) then
1090: raise fnd_api.g_exc_error;
1091: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1092: raise fnd_api.g_exc_unexpected_error;
1093: end if;
1094:
1087: X_WF_PROCESS_ID =>l_wf_process_id);
1088:
1089: if (l_return_status = fnd_api.g_ret_sts_error) then
1090: raise fnd_api.g_exc_error;
1091: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1092: raise fnd_api.g_exc_unexpected_error;
1093: end if;
1094:
1095: -- Insert the wf_process_id
1088:
1089: if (l_return_status = fnd_api.g_ret_sts_error) then
1090: raise fnd_api.g_exc_error;
1091: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1092: raise fnd_api.g_exc_unexpected_error;
1093: end if;
1094:
1095: -- Insert the wf_process_id
1096:
1112: x_return_status => l_return_status,
1113: x_msg_count => x_msg_count,
1114: x_msg_data => x_msg_data);
1115:
1116: if l_return_status = fnd_api.g_ret_sts_error then
1117: raise fnd_api.g_exc_error;
1118: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1119: raise fnd_api.g_exc_unexpected_error;
1120: end if;
1113: x_msg_count => x_msg_count,
1114: x_msg_data => x_msg_data);
1115:
1116: if l_return_status = fnd_api.g_ret_sts_error then
1117: raise fnd_api.g_exc_error;
1118: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1119: raise fnd_api.g_exc_unexpected_error;
1120: end if;
1121:
1114: x_msg_data => x_msg_data);
1115:
1116: if l_return_status = fnd_api.g_ret_sts_error then
1117: raise fnd_api.g_exc_error;
1118: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1119: raise fnd_api.g_exc_unexpected_error;
1120: end if;
1121:
1122: end if;
1115:
1116: if l_return_status = fnd_api.g_ret_sts_error then
1117: raise fnd_api.g_exc_error;
1118: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1119: raise fnd_api.g_exc_unexpected_error;
1120: end if;
1121:
1122: end if;
1123:
1135: x_return_status => l_return_status,
1136: x_msg_count => x_msg_count,
1137: x_msg_data => x_msg_data);
1138:
1139: if l_return_status = fnd_api.g_ret_sts_error then
1140: raise fnd_api.g_exc_error;
1141: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1142: raise fnd_api.g_exc_unexpected_error;
1143: end if;
1136: x_msg_count => x_msg_count,
1137: x_msg_data => x_msg_data);
1138:
1139: if l_return_status = fnd_api.g_ret_sts_error then
1140: raise fnd_api.g_exc_error;
1141: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1142: raise fnd_api.g_exc_unexpected_error;
1143: end if;
1144:
1137: x_msg_data => x_msg_data);
1138:
1139: if l_return_status = fnd_api.g_ret_sts_error then
1140: raise fnd_api.g_exc_error;
1141: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1142: raise fnd_api.g_exc_unexpected_error;
1143: end if;
1144:
1145: end if;
1138:
1139: if l_return_status = fnd_api.g_ret_sts_error then
1140: raise fnd_api.g_exc_error;
1141: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1142: raise fnd_api.g_exc_unexpected_error;
1143: end if;
1144:
1145: end if;
1146:
1148: x_esc_id := l_escalation_id;
1149: x_esc_number := l_escalation_number;
1150: x_workflow_process_id := l_wf_process_id;
1151:
1152: IF FND_API.To_Boolean( p_commit ) THEN
1153: COMMIT WORK;
1154: END IF;
1155:
1156: fnd_msg_pub.count_and_get
1159: );
1160:
1161: EXCEPTION
1162:
1163: WHEN fnd_api.g_exc_error
1164: THEN
1165: ROLLBACK TO Create_Escalation;
1166: x_return_status := fnd_api.g_ret_sts_error;
1167:
1162:
1163: WHEN fnd_api.g_exc_error
1164: THEN
1165: ROLLBACK TO Create_Escalation;
1166: x_return_status := fnd_api.g_ret_sts_error;
1167:
1168: fnd_msg_pub.count_and_get (
1169: p_count => x_msg_count,
1170: p_data => x_msg_data
1169: p_count => x_msg_count,
1170: p_data => x_msg_data
1171: );
1172:
1173: WHEN fnd_api.g_exc_unexpected_error
1174: THEN
1175:
1176: ROLLBACK TO Create_Escalation;
1177: x_return_status := fnd_api.g_ret_sts_unexp_error;
1173: WHEN fnd_api.g_exc_unexpected_error
1174: THEN
1175:
1176: ROLLBACK TO Create_Escalation;
1177: x_return_status := fnd_api.g_ret_sts_unexp_error;
1178: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
1179: p_data => x_msg_data);
1180:
1181: WHEN OTHERS
1180:
1181: WHEN OTHERS
1182: THEN
1183: ROLLBACK TO Create_Escalation;
1184: x_return_status := fnd_api.g_ret_sts_unexp_error;
1185:
1186: if FND_MSG_PUB.Check_Msg_Level
1187: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1188: then
1194: END CREATE_ESCALATION;
1195:
1196: PROCEDURE UPDATE_ESCALATION (
1197: p_api_version IN NUMBER,
1198: p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
1199: p_commit IN VARCHAR2 DEFAULT fnd_api.g_false,
1200: x_return_status OUT NOCOPY VARCHAR2,
1201: x_msg_count OUT NOCOPY NUMBER,
1202: x_msg_data OUT NOCOPY VARCHAR2,
1195:
1196: PROCEDURE UPDATE_ESCALATION (
1197: p_api_version IN NUMBER,
1198: p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
1199: p_commit IN VARCHAR2 DEFAULT fnd_api.g_false,
1200: x_return_status OUT NOCOPY VARCHAR2,
1201: x_msg_count OUT NOCOPY NUMBER,
1202: x_msg_data OUT NOCOPY VARCHAR2,
1203: p_resp_appl_id IN NUMBER := NULL,
1275: SAVEPOINT Update_Escalation;
1276:
1277: -- Standard call to check for call compatibility.
1278:
1279: IF NOT FND_API.Compatible_API_Call ( l_api_version, p_api_version,
1280: l_api_name, G_PKG_NAME)
1281: THEN
1282: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1283: END IF;
1278:
1279: IF NOT FND_API.Compatible_API_Call ( l_api_version, p_api_version,
1280: l_api_name, G_PKG_NAME)
1281: THEN
1282: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1283: END IF;
1284:
1285: -- Check p_init_msg_list
1286:
1283: END IF;
1284:
1285: -- Check p_init_msg_list
1286:
1287: IF FND_API.To_Boolean( p_init_msg_list ) THEN
1288: FND_MSG_PUB.initialize;
1289: END IF;
1290:
1291: -- Initialize API return status to success
1289: END IF;
1290:
1291: -- Initialize API return status to success
1292:
1293: x_return_status := FND_API.G_RET_STS_SUCCESS;
1294:
1295: --------------------------------------------------------------------------------------------
1296: -- standard customer user hook pre-processing
1297: --------------------------------------------------------------------------------------------
1308: x_return_status => l_return_status,
1309: x_msg_count => x_msg_count,
1310: x_msg_data => x_msg_data);
1311:
1312: if l_return_status = fnd_api.g_ret_sts_error then
1313: raise fnd_api.g_exc_error;
1314: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1315: raise fnd_api.g_exc_unexpected_error;
1316: end if;
1309: x_msg_count => x_msg_count,
1310: x_msg_data => x_msg_data);
1311:
1312: if l_return_status = fnd_api.g_ret_sts_error then
1313: raise fnd_api.g_exc_error;
1314: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1315: raise fnd_api.g_exc_unexpected_error;
1316: end if;
1317:
1310: x_msg_data => x_msg_data);
1311:
1312: if l_return_status = fnd_api.g_ret_sts_error then
1313: raise fnd_api.g_exc_error;
1314: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1315: raise fnd_api.g_exc_unexpected_error;
1316: end if;
1317:
1318: end if;
1311:
1312: if l_return_status = fnd_api.g_ret_sts_error then
1313: raise fnd_api.g_exc_error;
1314: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1315: raise fnd_api.g_exc_unexpected_error;
1316: end if;
1317:
1318: end if;
1319: --------------------------------------------------------------------------------------------
1333: x_return_status => l_return_status,
1334: x_msg_count => x_msg_count,
1335: x_msg_data => x_msg_data);
1336:
1337: if l_return_status = fnd_api.g_ret_sts_error then
1338: raise fnd_api.g_exc_error;
1339: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1340: raise fnd_api.g_exc_unexpected_error;
1341: end if;
1334: x_msg_count => x_msg_count,
1335: x_msg_data => x_msg_data);
1336:
1337: if l_return_status = fnd_api.g_ret_sts_error then
1338: raise fnd_api.g_exc_error;
1339: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1340: raise fnd_api.g_exc_unexpected_error;
1341: end if;
1342:
1335: x_msg_data => x_msg_data);
1336:
1337: if l_return_status = fnd_api.g_ret_sts_error then
1338: raise fnd_api.g_exc_error;
1339: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1340: raise fnd_api.g_exc_unexpected_error;
1341: end if;
1342:
1343: end if;
1336:
1337: if l_return_status = fnd_api.g_ret_sts_error then
1338: raise fnd_api.g_exc_error;
1339: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
1340: raise fnd_api.g_exc_unexpected_error;
1341: end if;
1342:
1343: end if;
1344:
1350:
1351: if l_user_id is NOT NULL then
1352: jtf_ec_util.Validate_Who_Info( l_api_name, l_user_id,
1353: l_login_id, l_return_status);
1354: if (l_return_status = fnd_api.g_ret_sts_error) then
1355: raise fnd_api.g_exc_error;
1356: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1357: raise fnd_api.g_exc_unexpected_error;
1358: end if;
1351: if l_user_id is NOT NULL then
1352: jtf_ec_util.Validate_Who_Info( l_api_name, l_user_id,
1353: l_login_id, l_return_status);
1354: if (l_return_status = fnd_api.g_ret_sts_error) then
1355: raise fnd_api.g_exc_error;
1356: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1357: raise fnd_api.g_exc_unexpected_error;
1358: end if;
1359: else
1352: jtf_ec_util.Validate_Who_Info( l_api_name, l_user_id,
1353: l_login_id, l_return_status);
1354: if (l_return_status = fnd_api.g_ret_sts_error) then
1355: raise fnd_api.g_exc_error;
1356: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1357: raise fnd_api.g_exc_unexpected_error;
1358: end if;
1359: else
1360: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
1353: l_login_id, l_return_status);
1354: if (l_return_status = fnd_api.g_ret_sts_error) then
1355: raise fnd_api.g_exc_error;
1356: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1357: raise fnd_api.g_exc_unexpected_error;
1358: end if;
1359: else
1360: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
1361: raise fnd_api.g_exc_error;
1357: raise fnd_api.g_exc_unexpected_error;
1358: end if;
1359: else
1360: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
1361: raise fnd_api.g_exc_error;
1362: end if;
1363:
1364: -------------------------------------------------------------------------
1365: -- Validate Escalation Task
1365: -- Validate Escalation Task
1366: -- Performs also number to id conversion
1367: -------------------------------------------------------------------------
1368:
1369: if p_esc_id <> fnd_api.g_miss_num then
1370: l_escalation_id := p_esc_id;
1371: if p_esc_number <> fnd_api.g_miss_char then
1372: jtf_ec_util.add_param_ignored_msg(l_api_name, 'p_esc_number');
1373: end if;
1367: -------------------------------------------------------------------------
1368:
1369: if p_esc_id <> fnd_api.g_miss_num then
1370: l_escalation_id := p_esc_id;
1371: if p_esc_number <> fnd_api.g_miss_char then
1372: jtf_ec_util.add_param_ignored_msg(l_api_name, 'p_esc_number');
1373: end if;
1374: elsif p_esc_number <> fnd_api.g_miss_char then
1375: l_escalation_number := p_esc_number;
1370: l_escalation_id := p_esc_id;
1371: if p_esc_number <> fnd_api.g_miss_char then
1372: jtf_ec_util.add_param_ignored_msg(l_api_name, 'p_esc_number');
1373: end if;
1374: elsif p_esc_number <> fnd_api.g_miss_char then
1375: l_escalation_number := p_esc_number;
1376: else jtf_ec_util.add_missing_param_msg(l_api_name, 'p_esc_name');
1377: end if;
1378:
1379: jtf_ec_util.Validate_Esc_Document(l_escalation_id, l_escalation_number,
1380: l_esc_task_id, -- converted number to id
1381: l_return_status);
1382:
1383: if (l_return_status = fnd_api.g_ret_sts_error) then
1384: raise fnd_api.g_exc_error;
1385: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1386: raise fnd_api.g_exc_unexpected_error;
1387: end if;
1380: l_esc_task_id, -- converted number to id
1381: l_return_status);
1382:
1383: if (l_return_status = fnd_api.g_ret_sts_error) then
1384: raise fnd_api.g_exc_error;
1385: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1386: raise fnd_api.g_exc_unexpected_error;
1387: end if;
1388:
1381: l_return_status);
1382:
1383: if (l_return_status = fnd_api.g_ret_sts_error) then
1384: raise fnd_api.g_exc_error;
1385: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1386: raise fnd_api.g_exc_unexpected_error;
1387: end if;
1388:
1389: l_escalation_id := l_esc_task_id;
1382:
1383: if (l_return_status = fnd_api.g_ret_sts_error) then
1384: raise fnd_api.g_exc_error;
1385: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1386: raise fnd_api.g_exc_unexpected_error;
1387: end if;
1388:
1389: l_escalation_id := l_esc_task_id;
1390:
1401: and (l_esc_record.status_name is NULL)
1402: then
1403: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL', 'status_id');
1404: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL', 'status_name');
1405: raise fnd_api.g_exc_error;
1406: end if;
1407:
1408: l_return_status := 'x';
1409:
1406: end if;
1407:
1408: l_return_status := 'x';
1409:
1410: if l_esc_record.status_id <> fnd_api.g_miss_num
1411: or l_esc_record.status_name <> fnd_api.g_miss_char then
1412:
1413: jtf_ec_util.Validate_Esc_Status(p_esc_status_id => l_esc_record.status_id,
1414: p_esc_status_name => l_esc_record.status_name,
1407:
1408: l_return_status := 'x';
1409:
1410: if l_esc_record.status_id <> fnd_api.g_miss_num
1411: or l_esc_record.status_name <> fnd_api.g_miss_char then
1412:
1413: jtf_ec_util.Validate_Esc_Status(p_esc_status_id => l_esc_record.status_id,
1414: p_esc_status_name => l_esc_record.status_name,
1415: x_return_status => l_return_status,
1414: p_esc_status_name => l_esc_record.status_name,
1415: x_return_status => l_return_status,
1416: x_esc_status_id => l_esc_status_id);
1417:
1418: if l_return_status <> fnd_api.g_ret_sts_success then
1419: raise fnd_api.g_exc_error;
1420: end if;
1421:
1422: end if;
1415: x_return_status => l_return_status,
1416: x_esc_status_id => l_esc_status_id);
1417:
1418: if l_return_status <> fnd_api.g_ret_sts_success then
1419: raise fnd_api.g_exc_error;
1420: end if;
1421:
1422: end if;
1423:
1426: ----------------------------------------------------------------------------------------
1427:
1428: if l_esc_record.escalation_level is NULL then
1429: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, l_esc_record.escalation_level, 'escalation_level');
1430: raise fnd_api.g_exc_error;
1431: elsif l_esc_record.escalation_level <> fnd_api.g_miss_char then
1432:
1433: if jtf_ec_util.Validate_Lookup('JTF_TASK_ESC_LEVEL',
1434: l_esc_record.escalation_level ) = FALSE
1427:
1428: if l_esc_record.escalation_level is NULL then
1429: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, l_esc_record.escalation_level, 'escalation_level');
1430: raise fnd_api.g_exc_error;
1431: elsif l_esc_record.escalation_level <> fnd_api.g_miss_char then
1432:
1433: if jtf_ec_util.Validate_Lookup('JTF_TASK_ESC_LEVEL',
1434: l_esc_record.escalation_level ) = FALSE
1435: then
1433: if jtf_ec_util.Validate_Lookup('JTF_TASK_ESC_LEVEL',
1434: l_esc_record.escalation_level ) = FALSE
1435: then
1436: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, l_esc_record.escalation_level, 'escalation_level');
1437: raise fnd_api.g_exc_error;
1438: end if;
1439:
1440: end if;
1441:
1446: jtf_ec_util.Check_Completed_Status(l_esc_status_id, l_escalation_id,
1447: l_esc_record.escalation_level,
1448: l_closed_flag, l_return_status);
1449:
1450: if (l_return_status = fnd_api.g_ret_sts_error) then
1451: raise fnd_api.g_exc_error;
1452: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1453: raise fnd_api.g_exc_unexpected_error;
1454: elsif l_closed_flag = 'Y' then
1447: l_esc_record.escalation_level,
1448: l_closed_flag, l_return_status);
1449:
1450: if (l_return_status = fnd_api.g_ret_sts_error) then
1451: raise fnd_api.g_exc_error;
1452: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1453: raise fnd_api.g_exc_unexpected_error;
1454: elsif l_closed_flag = 'Y' then
1455: l_esc_close_date := sysdate;
1448: l_closed_flag, l_return_status);
1449:
1450: if (l_return_status = fnd_api.g_ret_sts_error) then
1451: raise fnd_api.g_exc_error;
1452: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1453: raise fnd_api.g_exc_unexpected_error;
1454: elsif l_closed_flag = 'Y' then
1455: l_esc_close_date := sysdate;
1456: end if;
1449:
1450: if (l_return_status = fnd_api.g_ret_sts_error) then
1451: raise fnd_api.g_exc_error;
1452: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1453: raise fnd_api.g_exc_unexpected_error;
1454: elsif l_closed_flag = 'Y' then
1455: l_esc_close_date := sysdate;
1456: end if;
1457:
1459: -------------------------------------------------------------------------
1460: -- validate Escalation Owner
1461: -------------------------------------------------------------------------
1462: if l_esc_record.esc_owner_type_code is NULL OR
1463: l_esc_record.esc_owner_type_code = fnd_api.g_miss_char then
1464: l_esc_record.esc_owner_type_code := g_escalation_owner_type_code;
1465: end if;
1466:
1467: jtf_ec_util.validate_owner( l_esc_record.esc_owner_id,
1466:
1467: jtf_ec_util.validate_owner( l_esc_record.esc_owner_id,
1468: l_esc_record.esc_owner_type_code,
1469: l_return_status);
1470: if l_return_status <> fnd_api.g_ret_sts_success then
1471: raise fnd_api.g_exc_error;
1472: end if;
1473: --End
1474:
1467: jtf_ec_util.validate_owner( l_esc_record.esc_owner_id,
1468: l_esc_record.esc_owner_type_code,
1469: l_return_status);
1470: if l_return_status <> fnd_api.g_ret_sts_success then
1471: raise fnd_api.g_exc_error;
1472: end if;
1473: --End
1474:
1475: ----------------------------------------------------------------------------------------
1475: ----------------------------------------------------------------------------------------
1476: -- validate reason code
1477: ----------------------------------------------------------------------------------------
1478:
1479: if (l_esc_record.reason_code <> fnd_api.g_miss_char)
1480: then
1481: if jtf_ec_util.Validate_Lookup('JTF_TASK_REASON_CODES',
1482: l_esc_record.reason_code) = FALSE
1483: then
1481: if jtf_ec_util.Validate_Lookup('JTF_TASK_REASON_CODES',
1482: l_esc_record.reason_code) = FALSE
1483: then
1484: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, l_esc_record.reason_code, 'reason_code');
1485: raise fnd_api.g_exc_error;
1486: end if;
1487: end if;
1488:
1489: open c_get_old_esc_data(l_escalation_id);
1496: -- Update escalation header
1497: -------------------------------------------------------------------------
1498:
1499: --bug 2723761
1500: if NOT (l_esc_record.esc_name = FND_API.G_MISS_CHAR
1501: and l_esc_record.esc_description = FND_API.G_MISS_CHAR
1502: and l_esc_record.status_id = FND_API.G_MISS_NUM
1503: and l_esc_record.status_name = FND_API.G_MISS_CHAR
1504: and l_esc_record.esc_owner_id = FND_API.G_MISS_NUM
1497: -------------------------------------------------------------------------
1498:
1499: --bug 2723761
1500: if NOT (l_esc_record.esc_name = FND_API.G_MISS_CHAR
1501: and l_esc_record.esc_description = FND_API.G_MISS_CHAR
1502: and l_esc_record.status_id = FND_API.G_MISS_NUM
1503: and l_esc_record.status_name = FND_API.G_MISS_CHAR
1504: and l_esc_record.esc_owner_id = FND_API.G_MISS_NUM
1505: and l_esc_record.esc_owner_type_code = FND_API.G_MISS_CHAR
1498:
1499: --bug 2723761
1500: if NOT (l_esc_record.esc_name = FND_API.G_MISS_CHAR
1501: and l_esc_record.esc_description = FND_API.G_MISS_CHAR
1502: and l_esc_record.status_id = FND_API.G_MISS_NUM
1503: and l_esc_record.status_name = FND_API.G_MISS_CHAR
1504: and l_esc_record.esc_owner_id = FND_API.G_MISS_NUM
1505: and l_esc_record.esc_owner_type_code = FND_API.G_MISS_CHAR
1506: and l_esc_record.cust_account_id = FND_API.G_MISS_NUM
1499: --bug 2723761
1500: if NOT (l_esc_record.esc_name = FND_API.G_MISS_CHAR
1501: and l_esc_record.esc_description = FND_API.G_MISS_CHAR
1502: and l_esc_record.status_id = FND_API.G_MISS_NUM
1503: and l_esc_record.status_name = FND_API.G_MISS_CHAR
1504: and l_esc_record.esc_owner_id = FND_API.G_MISS_NUM
1505: and l_esc_record.esc_owner_type_code = FND_API.G_MISS_CHAR
1506: and l_esc_record.cust_account_id = FND_API.G_MISS_NUM
1507: and l_esc_record.cust_account_number = FND_API.G_MISS_CHAR
1500: if NOT (l_esc_record.esc_name = FND_API.G_MISS_CHAR
1501: and l_esc_record.esc_description = FND_API.G_MISS_CHAR
1502: and l_esc_record.status_id = FND_API.G_MISS_NUM
1503: and l_esc_record.status_name = FND_API.G_MISS_CHAR
1504: and l_esc_record.esc_owner_id = FND_API.G_MISS_NUM
1505: and l_esc_record.esc_owner_type_code = FND_API.G_MISS_CHAR
1506: and l_esc_record.cust_account_id = FND_API.G_MISS_NUM
1507: and l_esc_record.cust_account_number = FND_API.G_MISS_CHAR
1508: and l_esc_record.cust_address_id = FND_API.G_MISS_NUM
1501: and l_esc_record.esc_description = FND_API.G_MISS_CHAR
1502: and l_esc_record.status_id = FND_API.G_MISS_NUM
1503: and l_esc_record.status_name = FND_API.G_MISS_CHAR
1504: and l_esc_record.esc_owner_id = FND_API.G_MISS_NUM
1505: and l_esc_record.esc_owner_type_code = FND_API.G_MISS_CHAR
1506: and l_esc_record.cust_account_id = FND_API.G_MISS_NUM
1507: and l_esc_record.cust_account_number = FND_API.G_MISS_CHAR
1508: and l_esc_record.cust_address_id = FND_API.G_MISS_NUM
1509: and l_esc_record.cust_address_number = FND_API.G_MISS_CHAR
1502: and l_esc_record.status_id = FND_API.G_MISS_NUM
1503: and l_esc_record.status_name = FND_API.G_MISS_CHAR
1504: and l_esc_record.esc_owner_id = FND_API.G_MISS_NUM
1505: and l_esc_record.esc_owner_type_code = FND_API.G_MISS_CHAR
1506: and l_esc_record.cust_account_id = FND_API.G_MISS_NUM
1507: and l_esc_record.cust_account_number = FND_API.G_MISS_CHAR
1508: and l_esc_record.cust_address_id = FND_API.G_MISS_NUM
1509: and l_esc_record.cust_address_number = FND_API.G_MISS_CHAR
1510: and l_esc_record.esc_target_date = FND_API.G_MISS_DATE
1503: and l_esc_record.status_name = FND_API.G_MISS_CHAR
1504: and l_esc_record.esc_owner_id = FND_API.G_MISS_NUM
1505: and l_esc_record.esc_owner_type_code = FND_API.G_MISS_CHAR
1506: and l_esc_record.cust_account_id = FND_API.G_MISS_NUM
1507: and l_esc_record.cust_account_number = FND_API.G_MISS_CHAR
1508: and l_esc_record.cust_address_id = FND_API.G_MISS_NUM
1509: and l_esc_record.cust_address_number = FND_API.G_MISS_CHAR
1510: and l_esc_record.esc_target_date = FND_API.G_MISS_DATE
1511: and l_esc_record.reason_code = FND_API.G_MISS_CHAR
1504: and l_esc_record.esc_owner_id = FND_API.G_MISS_NUM
1505: and l_esc_record.esc_owner_type_code = FND_API.G_MISS_CHAR
1506: and l_esc_record.cust_account_id = FND_API.G_MISS_NUM
1507: and l_esc_record.cust_account_number = FND_API.G_MISS_CHAR
1508: and l_esc_record.cust_address_id = FND_API.G_MISS_NUM
1509: and l_esc_record.cust_address_number = FND_API.G_MISS_CHAR
1510: and l_esc_record.esc_target_date = FND_API.G_MISS_DATE
1511: and l_esc_record.reason_code = FND_API.G_MISS_CHAR
1512: and l_esc_record.escalation_level = FND_API.G_MISS_CHAR
1505: and l_esc_record.esc_owner_type_code = FND_API.G_MISS_CHAR
1506: and l_esc_record.cust_account_id = FND_API.G_MISS_NUM
1507: and l_esc_record.cust_account_number = FND_API.G_MISS_CHAR
1508: and l_esc_record.cust_address_id = FND_API.G_MISS_NUM
1509: and l_esc_record.cust_address_number = FND_API.G_MISS_CHAR
1510: and l_esc_record.esc_target_date = FND_API.G_MISS_DATE
1511: and l_esc_record.reason_code = FND_API.G_MISS_CHAR
1512: and l_esc_record.escalation_level = FND_API.G_MISS_CHAR
1513: and l_esc_record.attribute1 = FND_API.G_MISS_CHAR
1506: and l_esc_record.cust_account_id = FND_API.G_MISS_NUM
1507: and l_esc_record.cust_account_number = FND_API.G_MISS_CHAR
1508: and l_esc_record.cust_address_id = FND_API.G_MISS_NUM
1509: and l_esc_record.cust_address_number = FND_API.G_MISS_CHAR
1510: and l_esc_record.esc_target_date = FND_API.G_MISS_DATE
1511: and l_esc_record.reason_code = FND_API.G_MISS_CHAR
1512: and l_esc_record.escalation_level = FND_API.G_MISS_CHAR
1513: and l_esc_record.attribute1 = FND_API.G_MISS_CHAR
1514: and l_esc_record.attribute2 = FND_API.G_MISS_CHAR
1507: and l_esc_record.cust_account_number = FND_API.G_MISS_CHAR
1508: and l_esc_record.cust_address_id = FND_API.G_MISS_NUM
1509: and l_esc_record.cust_address_number = FND_API.G_MISS_CHAR
1510: and l_esc_record.esc_target_date = FND_API.G_MISS_DATE
1511: and l_esc_record.reason_code = FND_API.G_MISS_CHAR
1512: and l_esc_record.escalation_level = FND_API.G_MISS_CHAR
1513: and l_esc_record.attribute1 = FND_API.G_MISS_CHAR
1514: and l_esc_record.attribute2 = FND_API.G_MISS_CHAR
1515: and l_esc_record.attribute3 = FND_API.G_MISS_CHAR
1508: and l_esc_record.cust_address_id = FND_API.G_MISS_NUM
1509: and l_esc_record.cust_address_number = FND_API.G_MISS_CHAR
1510: and l_esc_record.esc_target_date = FND_API.G_MISS_DATE
1511: and l_esc_record.reason_code = FND_API.G_MISS_CHAR
1512: and l_esc_record.escalation_level = FND_API.G_MISS_CHAR
1513: and l_esc_record.attribute1 = FND_API.G_MISS_CHAR
1514: and l_esc_record.attribute2 = FND_API.G_MISS_CHAR
1515: and l_esc_record.attribute3 = FND_API.G_MISS_CHAR
1516: and l_esc_record.attribute4 = FND_API.G_MISS_CHAR
1509: and l_esc_record.cust_address_number = FND_API.G_MISS_CHAR
1510: and l_esc_record.esc_target_date = FND_API.G_MISS_DATE
1511: and l_esc_record.reason_code = FND_API.G_MISS_CHAR
1512: and l_esc_record.escalation_level = FND_API.G_MISS_CHAR
1513: and l_esc_record.attribute1 = FND_API.G_MISS_CHAR
1514: and l_esc_record.attribute2 = FND_API.G_MISS_CHAR
1515: and l_esc_record.attribute3 = FND_API.G_MISS_CHAR
1516: and l_esc_record.attribute4 = FND_API.G_MISS_CHAR
1517: and l_esc_record.attribute5 = FND_API.G_MISS_CHAR
1510: and l_esc_record.esc_target_date = FND_API.G_MISS_DATE
1511: and l_esc_record.reason_code = FND_API.G_MISS_CHAR
1512: and l_esc_record.escalation_level = FND_API.G_MISS_CHAR
1513: and l_esc_record.attribute1 = FND_API.G_MISS_CHAR
1514: and l_esc_record.attribute2 = FND_API.G_MISS_CHAR
1515: and l_esc_record.attribute3 = FND_API.G_MISS_CHAR
1516: and l_esc_record.attribute4 = FND_API.G_MISS_CHAR
1517: and l_esc_record.attribute5 = FND_API.G_MISS_CHAR
1518: and l_esc_record.attribute6 = FND_API.G_MISS_CHAR
1511: and l_esc_record.reason_code = FND_API.G_MISS_CHAR
1512: and l_esc_record.escalation_level = FND_API.G_MISS_CHAR
1513: and l_esc_record.attribute1 = FND_API.G_MISS_CHAR
1514: and l_esc_record.attribute2 = FND_API.G_MISS_CHAR
1515: and l_esc_record.attribute3 = FND_API.G_MISS_CHAR
1516: and l_esc_record.attribute4 = FND_API.G_MISS_CHAR
1517: and l_esc_record.attribute5 = FND_API.G_MISS_CHAR
1518: and l_esc_record.attribute6 = FND_API.G_MISS_CHAR
1519: and l_esc_record.attribute7 = FND_API.G_MISS_CHAR
1512: and l_esc_record.escalation_level = FND_API.G_MISS_CHAR
1513: and l_esc_record.attribute1 = FND_API.G_MISS_CHAR
1514: and l_esc_record.attribute2 = FND_API.G_MISS_CHAR
1515: and l_esc_record.attribute3 = FND_API.G_MISS_CHAR
1516: and l_esc_record.attribute4 = FND_API.G_MISS_CHAR
1517: and l_esc_record.attribute5 = FND_API.G_MISS_CHAR
1518: and l_esc_record.attribute6 = FND_API.G_MISS_CHAR
1519: and l_esc_record.attribute7 = FND_API.G_MISS_CHAR
1520: and l_esc_record.attribute8 = FND_API.G_MISS_CHAR
1513: and l_esc_record.attribute1 = FND_API.G_MISS_CHAR
1514: and l_esc_record.attribute2 = FND_API.G_MISS_CHAR
1515: and l_esc_record.attribute3 = FND_API.G_MISS_CHAR
1516: and l_esc_record.attribute4 = FND_API.G_MISS_CHAR
1517: and l_esc_record.attribute5 = FND_API.G_MISS_CHAR
1518: and l_esc_record.attribute6 = FND_API.G_MISS_CHAR
1519: and l_esc_record.attribute7 = FND_API.G_MISS_CHAR
1520: and l_esc_record.attribute8 = FND_API.G_MISS_CHAR
1521: and l_esc_record.attribute9 = FND_API.G_MISS_CHAR
1514: and l_esc_record.attribute2 = FND_API.G_MISS_CHAR
1515: and l_esc_record.attribute3 = FND_API.G_MISS_CHAR
1516: and l_esc_record.attribute4 = FND_API.G_MISS_CHAR
1517: and l_esc_record.attribute5 = FND_API.G_MISS_CHAR
1518: and l_esc_record.attribute6 = FND_API.G_MISS_CHAR
1519: and l_esc_record.attribute7 = FND_API.G_MISS_CHAR
1520: and l_esc_record.attribute8 = FND_API.G_MISS_CHAR
1521: and l_esc_record.attribute9 = FND_API.G_MISS_CHAR
1522: and l_esc_record.attribute10 = FND_API.G_MISS_CHAR
1515: and l_esc_record.attribute3 = FND_API.G_MISS_CHAR
1516: and l_esc_record.attribute4 = FND_API.G_MISS_CHAR
1517: and l_esc_record.attribute5 = FND_API.G_MISS_CHAR
1518: and l_esc_record.attribute6 = FND_API.G_MISS_CHAR
1519: and l_esc_record.attribute7 = FND_API.G_MISS_CHAR
1520: and l_esc_record.attribute8 = FND_API.G_MISS_CHAR
1521: and l_esc_record.attribute9 = FND_API.G_MISS_CHAR
1522: and l_esc_record.attribute10 = FND_API.G_MISS_CHAR
1523: and l_esc_record.attribute11 = FND_API.G_MISS_CHAR
1516: and l_esc_record.attribute4 = FND_API.G_MISS_CHAR
1517: and l_esc_record.attribute5 = FND_API.G_MISS_CHAR
1518: and l_esc_record.attribute6 = FND_API.G_MISS_CHAR
1519: and l_esc_record.attribute7 = FND_API.G_MISS_CHAR
1520: and l_esc_record.attribute8 = FND_API.G_MISS_CHAR
1521: and l_esc_record.attribute9 = FND_API.G_MISS_CHAR
1522: and l_esc_record.attribute10 = FND_API.G_MISS_CHAR
1523: and l_esc_record.attribute11 = FND_API.G_MISS_CHAR
1524: and l_esc_record.attribute12 = FND_API.G_MISS_CHAR
1517: and l_esc_record.attribute5 = FND_API.G_MISS_CHAR
1518: and l_esc_record.attribute6 = FND_API.G_MISS_CHAR
1519: and l_esc_record.attribute7 = FND_API.G_MISS_CHAR
1520: and l_esc_record.attribute8 = FND_API.G_MISS_CHAR
1521: and l_esc_record.attribute9 = FND_API.G_MISS_CHAR
1522: and l_esc_record.attribute10 = FND_API.G_MISS_CHAR
1523: and l_esc_record.attribute11 = FND_API.G_MISS_CHAR
1524: and l_esc_record.attribute12 = FND_API.G_MISS_CHAR
1525: and l_esc_record.attribute13 = FND_API.G_MISS_CHAR
1518: and l_esc_record.attribute6 = FND_API.G_MISS_CHAR
1519: and l_esc_record.attribute7 = FND_API.G_MISS_CHAR
1520: and l_esc_record.attribute8 = FND_API.G_MISS_CHAR
1521: and l_esc_record.attribute9 = FND_API.G_MISS_CHAR
1522: and l_esc_record.attribute10 = FND_API.G_MISS_CHAR
1523: and l_esc_record.attribute11 = FND_API.G_MISS_CHAR
1524: and l_esc_record.attribute12 = FND_API.G_MISS_CHAR
1525: and l_esc_record.attribute13 = FND_API.G_MISS_CHAR
1526: and l_esc_record.attribute14 = FND_API.G_MISS_CHAR
1519: and l_esc_record.attribute7 = FND_API.G_MISS_CHAR
1520: and l_esc_record.attribute8 = FND_API.G_MISS_CHAR
1521: and l_esc_record.attribute9 = FND_API.G_MISS_CHAR
1522: and l_esc_record.attribute10 = FND_API.G_MISS_CHAR
1523: and l_esc_record.attribute11 = FND_API.G_MISS_CHAR
1524: and l_esc_record.attribute12 = FND_API.G_MISS_CHAR
1525: and l_esc_record.attribute13 = FND_API.G_MISS_CHAR
1526: and l_esc_record.attribute14 = FND_API.G_MISS_CHAR
1527: and l_esc_record.attribute15 = FND_API.G_MISS_CHAR
1520: and l_esc_record.attribute8 = FND_API.G_MISS_CHAR
1521: and l_esc_record.attribute9 = FND_API.G_MISS_CHAR
1522: and l_esc_record.attribute10 = FND_API.G_MISS_CHAR
1523: and l_esc_record.attribute11 = FND_API.G_MISS_CHAR
1524: and l_esc_record.attribute12 = FND_API.G_MISS_CHAR
1525: and l_esc_record.attribute13 = FND_API.G_MISS_CHAR
1526: and l_esc_record.attribute14 = FND_API.G_MISS_CHAR
1527: and l_esc_record.attribute15 = FND_API.G_MISS_CHAR
1528: and l_esc_record.attribute_category = FND_API.G_MISS_CHAR) then
1521: and l_esc_record.attribute9 = FND_API.G_MISS_CHAR
1522: and l_esc_record.attribute10 = FND_API.G_MISS_CHAR
1523: and l_esc_record.attribute11 = FND_API.G_MISS_CHAR
1524: and l_esc_record.attribute12 = FND_API.G_MISS_CHAR
1525: and l_esc_record.attribute13 = FND_API.G_MISS_CHAR
1526: and l_esc_record.attribute14 = FND_API.G_MISS_CHAR
1527: and l_esc_record.attribute15 = FND_API.G_MISS_CHAR
1528: and l_esc_record.attribute_category = FND_API.G_MISS_CHAR) then
1529:
1522: and l_esc_record.attribute10 = FND_API.G_MISS_CHAR
1523: and l_esc_record.attribute11 = FND_API.G_MISS_CHAR
1524: and l_esc_record.attribute12 = FND_API.G_MISS_CHAR
1525: and l_esc_record.attribute13 = FND_API.G_MISS_CHAR
1526: and l_esc_record.attribute14 = FND_API.G_MISS_CHAR
1527: and l_esc_record.attribute15 = FND_API.G_MISS_CHAR
1528: and l_esc_record.attribute_category = FND_API.G_MISS_CHAR) then
1529:
1530: JTF_EC_PVT.UPDATE_ESCALATION (
1523: and l_esc_record.attribute11 = FND_API.G_MISS_CHAR
1524: and l_esc_record.attribute12 = FND_API.G_MISS_CHAR
1525: and l_esc_record.attribute13 = FND_API.G_MISS_CHAR
1526: and l_esc_record.attribute14 = FND_API.G_MISS_CHAR
1527: and l_esc_record.attribute15 = FND_API.G_MISS_CHAR
1528: and l_esc_record.attribute_category = FND_API.G_MISS_CHAR) then
1529:
1530: JTF_EC_PVT.UPDATE_ESCALATION (
1531: P_API_VERSION => l_api_version,
1524: and l_esc_record.attribute12 = FND_API.G_MISS_CHAR
1525: and l_esc_record.attribute13 = FND_API.G_MISS_CHAR
1526: and l_esc_record.attribute14 = FND_API.G_MISS_CHAR
1527: and l_esc_record.attribute15 = FND_API.G_MISS_CHAR
1528: and l_esc_record.attribute_category = FND_API.G_MISS_CHAR) then
1529:
1530: JTF_EC_PVT.UPDATE_ESCALATION (
1531: P_API_VERSION => l_api_version,
1532: P_INIT_MSG_LIST => fnd_api.g_false,
1528: and l_esc_record.attribute_category = FND_API.G_MISS_CHAR) then
1529:
1530: JTF_EC_PVT.UPDATE_ESCALATION (
1531: P_API_VERSION => l_api_version,
1532: P_INIT_MSG_LIST => fnd_api.g_false,
1533: P_COMMIT => fnd_api.g_false,
1534: P_OBJECT_VERSION_NUMBER => l_object_version_number,
1535: P_ESCALATION_ID => l_escalation_id,
1536: P_ESCALATION_NUMBER => l_escalation_number,
1529:
1530: JTF_EC_PVT.UPDATE_ESCALATION (
1531: P_API_VERSION => l_api_version,
1532: P_INIT_MSG_LIST => fnd_api.g_false,
1533: P_COMMIT => fnd_api.g_false,
1534: P_OBJECT_VERSION_NUMBER => l_object_version_number,
1535: P_ESCALATION_ID => l_escalation_id,
1536: P_ESCALATION_NUMBER => l_escalation_number,
1537: P_ESCALATION_NAME => l_esc_record.esc_name,
1579: p_attribute15 => l_esc_record.attribute15,
1580: p_attribute_category => l_esc_record.attribute_category
1581: );
1582:
1583: if (l_return_status = fnd_api.g_ret_sts_error) then
1584: raise fnd_api.g_exc_error;
1585: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1586: raise fnd_api.g_exc_unexpected_error;
1587: end if;
1580: p_attribute_category => l_esc_record.attribute_category
1581: );
1582:
1583: if (l_return_status = fnd_api.g_ret_sts_error) then
1584: raise fnd_api.g_exc_error;
1585: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1586: raise fnd_api.g_exc_unexpected_error;
1587: end if;
1588:
1581: );
1582:
1583: if (l_return_status = fnd_api.g_ret_sts_error) then
1584: raise fnd_api.g_exc_error;
1585: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1586: raise fnd_api.g_exc_unexpected_error;
1587: end if;
1588:
1589: end if;
1582:
1583: if (l_return_status = fnd_api.g_ret_sts_error) then
1584: raise fnd_api.g_exc_error;
1585: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1586: raise fnd_api.g_exc_unexpected_error;
1587: end if;
1588:
1589: end if;
1590:
1605:
1606: jtf_ec_util.Validate_Task_Reference_Id( l_reference_documents(j).reference_id,
1607: l_escalation_id, l_return_status);
1608:
1609: if (l_return_status = fnd_api.g_ret_sts_error) then
1610: raise fnd_api.g_exc_error;
1611: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1612: raise fnd_api.g_exc_unexpected_error;
1613: end if;
1606: jtf_ec_util.Validate_Task_Reference_Id( l_reference_documents(j).reference_id,
1607: l_escalation_id, l_return_status);
1608:
1609: if (l_return_status = fnd_api.g_ret_sts_error) then
1610: raise fnd_api.g_exc_error;
1611: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1612: raise fnd_api.g_exc_unexpected_error;
1613: end if;
1614:
1607: l_escalation_id, l_return_status);
1608:
1609: if (l_return_status = fnd_api.g_ret_sts_error) then
1610: raise fnd_api.g_exc_error;
1611: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1612: raise fnd_api.g_exc_unexpected_error;
1613: end if;
1614:
1615: JTF_EC_REFERENCES_PVT.DELETE_REFERENCES(
1608:
1609: if (l_return_status = fnd_api.g_ret_sts_error) then
1610: raise fnd_api.g_exc_error;
1611: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1612: raise fnd_api.g_exc_unexpected_error;
1613: end if;
1614:
1615: JTF_EC_REFERENCES_PVT.DELETE_REFERENCES(
1616: P_API_VERSION => l_api_version,
1613: end if;
1614:
1615: JTF_EC_REFERENCES_PVT.DELETE_REFERENCES(
1616: P_API_VERSION => l_api_version,
1617: P_INIT_MSG_LIST => fnd_api.g_false,
1618: P_COMMIT => fnd_api.g_false,
1619: P_OBJECT_VERSION_NUMBER => l_reference_documents(j).object_version_number,
1620: P_ESCALATION_REFERENCE_ID => l_reference_documents(j).reference_id,
1621: X_RETURN_STATUS =>l_return_status,
1614:
1615: JTF_EC_REFERENCES_PVT.DELETE_REFERENCES(
1616: P_API_VERSION => l_api_version,
1617: P_INIT_MSG_LIST => fnd_api.g_false,
1618: P_COMMIT => fnd_api.g_false,
1619: P_OBJECT_VERSION_NUMBER => l_reference_documents(j).object_version_number,
1620: P_ESCALATION_REFERENCE_ID => l_reference_documents(j).reference_id,
1621: X_RETURN_STATUS =>l_return_status,
1622: X_MSG_COUNT =>x_msg_count,
1621: X_RETURN_STATUS =>l_return_status,
1622: X_MSG_COUNT =>x_msg_count,
1623: X_MSG_DATA =>x_msg_data);
1624:
1625: if (l_return_status = fnd_api.g_ret_sts_error) then
1626: raise fnd_api.g_exc_error;
1627: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1628: raise fnd_api.g_exc_unexpected_error;
1629: end if;
1622: X_MSG_COUNT =>x_msg_count,
1623: X_MSG_DATA =>x_msg_data);
1624:
1625: if (l_return_status = fnd_api.g_ret_sts_error) then
1626: raise fnd_api.g_exc_error;
1627: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1628: raise fnd_api.g_exc_unexpected_error;
1629: end if;
1630: elsif l_reference_documents(j).action_code = 'U' then
1623: X_MSG_DATA =>x_msg_data);
1624:
1625: if (l_return_status = fnd_api.g_ret_sts_error) then
1626: raise fnd_api.g_exc_error;
1627: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1628: raise fnd_api.g_exc_unexpected_error;
1629: end if;
1630: elsif l_reference_documents(j).action_code = 'U' then
1631:
1624:
1625: if (l_return_status = fnd_api.g_ret_sts_error) then
1626: raise fnd_api.g_exc_error;
1627: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1628: raise fnd_api.g_exc_unexpected_error;
1629: end if;
1630: elsif l_reference_documents(j).action_code = 'U' then
1631:
1632: l_return_status := 'x';
1636: jtf_ec_util.Validate_Task_Reference_Id( l_reference_documents(j).reference_id,
1637: l_escalation_id,
1638: l_return_status);
1639:
1640: if (l_return_status = fnd_api.g_ret_sts_error) then
1641: raise fnd_api.g_exc_error;
1642: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1643: raise fnd_api.g_exc_unexpected_error;
1644: end if;
1637: l_escalation_id,
1638: l_return_status);
1639:
1640: if (l_return_status = fnd_api.g_ret_sts_error) then
1641: raise fnd_api.g_exc_error;
1642: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1643: raise fnd_api.g_exc_unexpected_error;
1644: end if;
1645:
1638: l_return_status);
1639:
1640: if (l_return_status = fnd_api.g_ret_sts_error) then
1641: raise fnd_api.g_exc_error;
1642: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1643: raise fnd_api.g_exc_unexpected_error;
1644: end if;
1645:
1646: if l_reference_documents(j).reference_code = 'ESC' then
1639:
1640: if (l_return_status = fnd_api.g_ret_sts_error) then
1641: raise fnd_api.g_exc_error;
1642: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1643: raise fnd_api.g_exc_unexpected_error;
1644: end if;
1645:
1646: if l_reference_documents(j).reference_code = 'ESC' then
1647:
1648: open c_get_ref_details(l_reference_documents(j).reference_id);
1649: fetch c_get_ref_details into l_object_type_code, l_object_id, l_object_name;
1650: close c_get_ref_details;
1651:
1652: if l_reference_documents(j).object_type_code <> fnd_api.g_miss_char then
1653: l_object_type_code := l_reference_documents(j).object_type_code;
1654: end if;
1655:
1656: if l_reference_documents(j).object_id <> fnd_api.g_miss_num then
1652: if l_reference_documents(j).object_type_code <> fnd_api.g_miss_char then
1653: l_object_type_code := l_reference_documents(j).object_type_code;
1654: end if;
1655:
1656: if l_reference_documents(j).object_id <> fnd_api.g_miss_num then
1657: l_object_id := l_reference_documents(j).object_id;
1658: end if;
1659:
1660: if l_reference_documents(j).object_name <> fnd_api.g_miss_char then
1656: if l_reference_documents(j).object_id <> fnd_api.g_miss_num then
1657: l_object_id := l_reference_documents(j).object_id;
1658: end if;
1659:
1660: if l_reference_documents(j).object_name <> fnd_api.g_miss_char then
1661: l_object_name := l_reference_documents(j).object_name;
1662: end if;
1663:
1664: if jtf_ec_util.check_if_escalated( l_object_type_code,
1672: fnd_message.set_name ('JTF', 'JTF_TK_ESC_DOC_EXIST');
1673: fnd_message.set_token('OBJECT_TYPE',l_object_type_code);
1674: fnd_message.set_token('OBJECT_NUMBER',l_object_name);
1675: fnd_msg_pub.Add;
1676: raise fnd_api.g_exc_error;
1677: end if;
1678: end if;
1679:
1680: end if;
1686: l_escalation_id) = FALSE then
1687:
1688: JTF_EC_REFERENCES_PVT.UPDATE_REFERENCES (
1689: P_API_VERSION => l_api_version,
1690: P_INIT_MSG_LIST => fnd_api.g_false,
1691: P_COMMIT => fnd_api.g_false,
1692: P_OBJECT_VERSION_NUMBER => l_reference_documents(j).object_version_number,
1693: P_ESCALATION_REFERENCE_ID => l_reference_documents(j).reference_id,
1694: P_OBJECT_TYPE_CODE => l_reference_documents(j).object_type_code,
1687:
1688: JTF_EC_REFERENCES_PVT.UPDATE_REFERENCES (
1689: P_API_VERSION => l_api_version,
1690: P_INIT_MSG_LIST => fnd_api.g_false,
1691: P_COMMIT => fnd_api.g_false,
1692: P_OBJECT_VERSION_NUMBER => l_reference_documents(j).object_version_number,
1693: P_ESCALATION_REFERENCE_ID => l_reference_documents(j).reference_id,
1694: P_OBJECT_TYPE_CODE => l_reference_documents(j).object_type_code,
1695: P_OBJECT_NAME => l_reference_documents(j).object_name,
1716: p_attribute14 => l_reference_documents(j).attribute14,
1717: p_attribute15 => l_reference_documents(j).attribute15,
1718: p_attribute_category => l_reference_documents(j).attribute_category);
1719:
1720: if (l_return_status = fnd_api.g_ret_sts_error) then
1721: raise fnd_api.g_exc_error;
1722: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1723: raise fnd_api.g_exc_unexpected_error;
1724: end if;
1717: p_attribute15 => l_reference_documents(j).attribute15,
1718: p_attribute_category => l_reference_documents(j).attribute_category);
1719:
1720: if (l_return_status = fnd_api.g_ret_sts_error) then
1721: raise fnd_api.g_exc_error;
1722: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1723: raise fnd_api.g_exc_unexpected_error;
1724: end if;
1725:
1718: p_attribute_category => l_reference_documents(j).attribute_category);
1719:
1720: if (l_return_status = fnd_api.g_ret_sts_error) then
1721: raise fnd_api.g_exc_error;
1722: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1723: raise fnd_api.g_exc_unexpected_error;
1724: end if;
1725:
1726: end if;
1719:
1720: if (l_return_status = fnd_api.g_ret_sts_error) then
1721: raise fnd_api.g_exc_error;
1722: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1723: raise fnd_api.g_exc_unexpected_error;
1724: end if;
1725:
1726: end if;
1727:
1733: -- check reference code
1734: -- if the reference code is not passed it will be defaulted from a profile option
1735: ----------------------------------------------------------------------------------
1736:
1737: if (l_reference_documents(j).reference_code = fnd_api.g_miss_char
1738: OR l_reference_documents(j).reference_code is NULL)
1739: then
1740: l_reference_documents(j).reference_code := FND_PROFILE.Value_Specific('JTF_EC_DEFAULT_REF_TYPE',
1741: l_user_id,
1750: x_msg_data,
1751: l_escalation_reference_id,
1752: l_return_status);
1753:
1754: if (l_return_status = fnd_api.g_ret_sts_error) then
1755: raise fnd_api.g_exc_error;
1756: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1757: raise fnd_api.g_exc_unexpected_error;
1758: end if;
1751: l_escalation_reference_id,
1752: l_return_status);
1753:
1754: if (l_return_status = fnd_api.g_ret_sts_error) then
1755: raise fnd_api.g_exc_error;
1756: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1757: raise fnd_api.g_exc_unexpected_error;
1758: end if;
1759:
1752: l_return_status);
1753:
1754: if (l_return_status = fnd_api.g_ret_sts_error) then
1755: raise fnd_api.g_exc_error;
1756: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1757: raise fnd_api.g_exc_unexpected_error;
1758: end if;
1759:
1760: end if;
1753:
1754: if (l_return_status = fnd_api.g_ret_sts_error) then
1755: raise fnd_api.g_exc_error;
1756: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1757: raise fnd_api.g_exc_unexpected_error;
1758: end if;
1759:
1760: end if;
1761:
1777: jtf_ec_util.validate_task_phone_id(l_cont_points(j).task_phone_id,
1778: l_escalation_id,
1779: l_return_status);
1780:
1781: if (l_return_status = fnd_api.g_ret_sts_error) then
1782: raise fnd_api.g_exc_error;
1783: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1784: raise fnd_api.g_exc_unexpected_error;
1785: end if;
1778: l_escalation_id,
1779: l_return_status);
1780:
1781: if (l_return_status = fnd_api.g_ret_sts_error) then
1782: raise fnd_api.g_exc_error;
1783: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1784: raise fnd_api.g_exc_unexpected_error;
1785: end if;
1786:
1779: l_return_status);
1780:
1781: if (l_return_status = fnd_api.g_ret_sts_error) then
1782: raise fnd_api.g_exc_error;
1783: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1784: raise fnd_api.g_exc_unexpected_error;
1785: end if;
1786:
1787: Jtf_Task_Phones_Pub.delete_task_phones (
1780:
1781: if (l_return_status = fnd_api.g_ret_sts_error) then
1782: raise fnd_api.g_exc_error;
1783: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1784: raise fnd_api.g_exc_unexpected_error;
1785: end if;
1786:
1787: Jtf_Task_Phones_Pub.delete_task_phones (
1788: p_api_version => l_api_version,
1785: end if;
1786:
1787: Jtf_Task_Phones_Pub.delete_task_phones (
1788: p_api_version => l_api_version,
1789: p_init_msg_list => fnd_api.g_false,
1790: p_commit => fnd_api.g_false,
1791: p_object_version_number => l_cont_points(j).object_version_number,
1792: p_task_phone_id => l_cont_points(j).task_phone_id,
1793: x_return_status => l_return_status,
1786:
1787: Jtf_Task_Phones_Pub.delete_task_phones (
1788: p_api_version => l_api_version,
1789: p_init_msg_list => fnd_api.g_false,
1790: p_commit => fnd_api.g_false,
1791: p_object_version_number => l_cont_points(j).object_version_number,
1792: p_task_phone_id => l_cont_points(j).task_phone_id,
1793: x_return_status => l_return_status,
1794: x_msg_data => x_msg_data,
1794: x_msg_data => x_msg_data,
1795: x_msg_count => x_msg_count
1796: );
1797:
1798: if (l_return_status = fnd_api.g_ret_sts_error) then
1799: raise fnd_api.g_exc_error;
1800: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1801: raise fnd_api.g_exc_unexpected_error;
1802: end if;
1795: x_msg_count => x_msg_count
1796: );
1797:
1798: if (l_return_status = fnd_api.g_ret_sts_error) then
1799: raise fnd_api.g_exc_error;
1800: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1801: raise fnd_api.g_exc_unexpected_error;
1802: end if;
1803:
1796: );
1797:
1798: if (l_return_status = fnd_api.g_ret_sts_error) then
1799: raise fnd_api.g_exc_error;
1800: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1801: raise fnd_api.g_exc_unexpected_error;
1802: end if;
1803:
1804: elsif l_cont_points(j).action_code = 'U' then
1797:
1798: if (l_return_status = fnd_api.g_ret_sts_error) then
1799: raise fnd_api.g_exc_error;
1800: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1801: raise fnd_api.g_exc_unexpected_error;
1802: end if;
1803:
1804: elsif l_cont_points(j).action_code = 'U' then
1805:
1810: jtf_ec_util.validate_task_phone_id(l_cont_points(j).task_phone_id,
1811: l_escalation_id,
1812: l_return_status);
1813:
1814: if (l_return_status = fnd_api.g_ret_sts_error) then
1815: raise fnd_api.g_exc_error;
1816: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1817: raise fnd_api.g_exc_unexpected_error;
1818: end if;
1811: l_escalation_id,
1812: l_return_status);
1813:
1814: if (l_return_status = fnd_api.g_ret_sts_error) then
1815: raise fnd_api.g_exc_error;
1816: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1817: raise fnd_api.g_exc_unexpected_error;
1818: end if;
1819:
1812: l_return_status);
1813:
1814: if (l_return_status = fnd_api.g_ret_sts_error) then
1815: raise fnd_api.g_exc_error;
1816: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1817: raise fnd_api.g_exc_unexpected_error;
1818: end if;
1819:
1820: l_return_status := 'x';
1813:
1814: if (l_return_status = fnd_api.g_ret_sts_error) then
1815: raise fnd_api.g_exc_error;
1816: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1817: raise fnd_api.g_exc_unexpected_error;
1818: end if;
1819:
1820: l_return_status := 'x';
1821:
1820: l_return_status := 'x';
1821:
1822: Jtf_Task_Phones_Pub.update_task_phones(
1823: p_api_version => l_api_version,
1824: p_init_msg_list => fnd_api.g_false,
1825: p_commit => fnd_api.g_false,
1826: p_object_version_number => l_cont_points(j).object_version_number,
1827: p_task_phone_id => l_cont_points(j).task_phone_id,
1828: p_phone_id => l_cont_points(j).contact_point_id,
1821:
1822: Jtf_Task_Phones_Pub.update_task_phones(
1823: p_api_version => l_api_version,
1824: p_init_msg_list => fnd_api.g_false,
1825: p_commit => fnd_api.g_false,
1826: p_object_version_number => l_cont_points(j).object_version_number,
1827: p_task_phone_id => l_cont_points(j).task_phone_id,
1828: p_phone_id => l_cont_points(j).contact_point_id,
1829: x_return_status => l_return_status,
1846: p_attribute15 => l_cont_points(j).attribute1,
1847: p_attribute_category => l_cont_points(j).attribute_category
1848: );
1849:
1850: if (l_return_status = fnd_api.g_ret_sts_error) then
1851: raise fnd_api.g_exc_error;
1852: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1853: raise fnd_api.g_exc_unexpected_error;
1854: end if;
1847: p_attribute_category => l_cont_points(j).attribute_category
1848: );
1849:
1850: if (l_return_status = fnd_api.g_ret_sts_error) then
1851: raise fnd_api.g_exc_error;
1852: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1853: raise fnd_api.g_exc_unexpected_error;
1854: end if;
1855: end if;
1848: );
1849:
1850: if (l_return_status = fnd_api.g_ret_sts_error) then
1851: raise fnd_api.g_exc_error;
1852: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1853: raise fnd_api.g_exc_unexpected_error;
1854: end if;
1855: end if;
1856: end loop;
1849:
1850: if (l_return_status = fnd_api.g_ret_sts_error) then
1851: raise fnd_api.g_exc_error;
1852: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1853: raise fnd_api.g_exc_unexpected_error;
1854: end if;
1855: end if;
1856: end loop;
1857:
1875: jtf_ec_util.Validate_Task_Contact_Id( l_esc_contacts(j).task_contact_id,
1876: l_escalation_id,
1877: l_return_status);
1878:
1879: if (l_return_status = fnd_api.g_ret_sts_error) then
1880: raise fnd_api.g_exc_error;
1881: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1882: raise fnd_api.g_exc_unexpected_error;
1883: end if;
1876: l_escalation_id,
1877: l_return_status);
1878:
1879: if (l_return_status = fnd_api.g_ret_sts_error) then
1880: raise fnd_api.g_exc_error;
1881: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1882: raise fnd_api.g_exc_unexpected_error;
1883: end if;
1884:
1877: l_return_status);
1878:
1879: if (l_return_status = fnd_api.g_ret_sts_error) then
1880: raise fnd_api.g_exc_error;
1881: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1882: raise fnd_api.g_exc_unexpected_error;
1883: end if;
1884:
1885: JTF_EC_CONTACTS_PVT.DELETE_ESCALATION_CONTACTS(
1878:
1879: if (l_return_status = fnd_api.g_ret_sts_error) then
1880: raise fnd_api.g_exc_error;
1881: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1882: raise fnd_api.g_exc_unexpected_error;
1883: end if;
1884:
1885: JTF_EC_CONTACTS_PVT.DELETE_ESCALATION_CONTACTS(
1886: P_API_VERSION => l_api_version,
1883: end if;
1884:
1885: JTF_EC_CONTACTS_PVT.DELETE_ESCALATION_CONTACTS(
1886: P_API_VERSION => l_api_version,
1887: P_INIT_MSG_LIST => fnd_api.g_false,
1888: P_COMMIT => fnd_api.g_false,
1889: P_OBJECT_VERSION_NUMBER => l_esc_contacts(j).object_version_number,
1890: P_ESCALATION_CONTACT_ID => l_esc_contacts(j).task_contact_id,
1891: X_RETURN_STATUS => l_return_status,
1884:
1885: JTF_EC_CONTACTS_PVT.DELETE_ESCALATION_CONTACTS(
1886: P_API_VERSION => l_api_version,
1887: P_INIT_MSG_LIST => fnd_api.g_false,
1888: P_COMMIT => fnd_api.g_false,
1889: P_OBJECT_VERSION_NUMBER => l_esc_contacts(j).object_version_number,
1890: P_ESCALATION_CONTACT_ID => l_esc_contacts(j).task_contact_id,
1891: X_RETURN_STATUS => l_return_status,
1892: X_MSG_COUNT => x_msg_count,
1891: X_RETURN_STATUS => l_return_status,
1892: X_MSG_COUNT => x_msg_count,
1893: X_MSG_DATA => x_msg_data);
1894:
1895: if (l_return_status = fnd_api.g_ret_sts_error) then
1896: raise fnd_api.g_exc_error;
1897: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1898: raise fnd_api.g_exc_unexpected_error;
1899: end if;
1892: X_MSG_COUNT => x_msg_count,
1893: X_MSG_DATA => x_msg_data);
1894:
1895: if (l_return_status = fnd_api.g_ret_sts_error) then
1896: raise fnd_api.g_exc_error;
1897: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1898: raise fnd_api.g_exc_unexpected_error;
1899: end if;
1900:
1893: X_MSG_DATA => x_msg_data);
1894:
1895: if (l_return_status = fnd_api.g_ret_sts_error) then
1896: raise fnd_api.g_exc_error;
1897: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1898: raise fnd_api.g_exc_unexpected_error;
1899: end if;
1900:
1901: -- delete the contact points
1894:
1895: if (l_return_status = fnd_api.g_ret_sts_error) then
1896: raise fnd_api.g_exc_error;
1897: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1898: raise fnd_api.g_exc_unexpected_error;
1899: end if;
1900:
1901: -- delete the contact points
1902:
1903: for c in c_cont_phone_id(l_esc_contacts(j).task_contact_id) loop
1904:
1905: Jtf_Task_Phones_Pub.delete_task_phones (
1906: p_api_version => l_api_version,
1907: p_init_msg_list => fnd_api.g_false,
1908: p_commit => fnd_api.g_false,
1909: p_object_version_number => c.object_version_number,
1910: p_task_phone_id => c.task_phone_id,
1911: x_return_status => l_return_status,
1904:
1905: Jtf_Task_Phones_Pub.delete_task_phones (
1906: p_api_version => l_api_version,
1907: p_init_msg_list => fnd_api.g_false,
1908: p_commit => fnd_api.g_false,
1909: p_object_version_number => c.object_version_number,
1910: p_task_phone_id => c.task_phone_id,
1911: x_return_status => l_return_status,
1912: x_msg_data => x_msg_data,
1912: x_msg_data => x_msg_data,
1913: x_msg_count => x_msg_count
1914: );
1915:
1916: if (l_return_status = fnd_api.g_ret_sts_error) then
1917: raise fnd_api.g_exc_error;
1918: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1919: raise fnd_api.g_exc_unexpected_error;
1920: end if;
1913: x_msg_count => x_msg_count
1914: );
1915:
1916: if (l_return_status = fnd_api.g_ret_sts_error) then
1917: raise fnd_api.g_exc_error;
1918: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1919: raise fnd_api.g_exc_unexpected_error;
1920: end if;
1921:
1914: );
1915:
1916: if (l_return_status = fnd_api.g_ret_sts_error) then
1917: raise fnd_api.g_exc_error;
1918: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1919: raise fnd_api.g_exc_unexpected_error;
1920: end if;
1921:
1922: end loop;
1915:
1916: if (l_return_status = fnd_api.g_ret_sts_error) then
1917: raise fnd_api.g_exc_error;
1918: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1919: raise fnd_api.g_exc_unexpected_error;
1920: end if;
1921:
1922: end loop;
1923:
1928: -- currently just the escalation_notify_flag and the escalation_requester_flag
1929: -- can be updated. Once the contact is created the contact_type_code and
1930: -- the contact_id cannot be changed.
1931:
1932: l_esc_contacts(j).contact_id := FND_API.G_MISS_NUM;
1933: l_esc_contacts(j).contact_type_code := FND_API.G_MISS_CHAR;
1934:
1935: if l_esc_contacts(j).escalation_notify_flag is NULL then
1936: l_esc_contacts(j).escalation_notify_flag := 'N';
1929: -- can be updated. Once the contact is created the contact_type_code and
1930: -- the contact_id cannot be changed.
1931:
1932: l_esc_contacts(j).contact_id := FND_API.G_MISS_NUM;
1933: l_esc_contacts(j).contact_type_code := FND_API.G_MISS_CHAR;
1934:
1935: if l_esc_contacts(j).escalation_notify_flag is NULL then
1936: l_esc_contacts(j).escalation_notify_flag := 'N';
1937: end if;
1945: jtf_ec_util.Validate_Task_Contact_Id( l_esc_contacts(j).task_contact_id,
1946: l_escalation_id,
1947: l_return_status);
1948:
1949: if (l_return_status = fnd_api.g_ret_sts_error) then
1950: raise fnd_api.g_exc_error;
1951: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1952: raise fnd_api.g_exc_unexpected_error;
1953: end if;
1946: l_escalation_id,
1947: l_return_status);
1948:
1949: if (l_return_status = fnd_api.g_ret_sts_error) then
1950: raise fnd_api.g_exc_error;
1951: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1952: raise fnd_api.g_exc_unexpected_error;
1953: end if;
1954:
1947: l_return_status);
1948:
1949: if (l_return_status = fnd_api.g_ret_sts_error) then
1950: raise fnd_api.g_exc_error;
1951: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1952: raise fnd_api.g_exc_unexpected_error;
1953: end if;
1954:
1955: JTF_EC_CONTACTS_PVT.UPDATE_ESCALATION_CONTACTS (
1948:
1949: if (l_return_status = fnd_api.g_ret_sts_error) then
1950: raise fnd_api.g_exc_error;
1951: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1952: raise fnd_api.g_exc_unexpected_error;
1953: end if;
1954:
1955: JTF_EC_CONTACTS_PVT.UPDATE_ESCALATION_CONTACTS (
1956: P_API_VERSION => l_api_version,
1953: end if;
1954:
1955: JTF_EC_CONTACTS_PVT.UPDATE_ESCALATION_CONTACTS (
1956: P_API_VERSION => l_api_version,
1957: P_INIT_MSG_LIST => fnd_api.g_false,
1958: P_COMMIT => fnd_api.g_false,
1959: P_OBJECT_VERSION_NUMBER => l_esc_contacts(j).object_version_number,
1960: P_ESCALATION_CONTACT_ID => l_esc_contacts(j).task_contact_id,
1961: P_CONTACT_ID => l_esc_contacts(j).contact_id,
1954:
1955: JTF_EC_CONTACTS_PVT.UPDATE_ESCALATION_CONTACTS (
1956: P_API_VERSION => l_api_version,
1957: P_INIT_MSG_LIST => fnd_api.g_false,
1958: P_COMMIT => fnd_api.g_false,
1959: P_OBJECT_VERSION_NUMBER => l_esc_contacts(j).object_version_number,
1960: P_ESCALATION_CONTACT_ID => l_esc_contacts(j).task_contact_id,
1961: P_CONTACT_ID => l_esc_contacts(j).contact_id,
1962: P_CONTACT_TYPE_CODE => l_esc_contacts(j).contact_type_code,
1982: p_attribute15 => l_esc_contacts(j).attribute15,
1983: p_attribute_category => l_esc_contacts(j).attribute_category
1984: );
1985:
1986: if (l_return_status = fnd_api.g_ret_sts_error) then
1987: raise fnd_api.g_exc_error;
1988: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1989: raise fnd_api.g_exc_unexpected_error;
1990: end if;
1983: p_attribute_category => l_esc_contacts(j).attribute_category
1984: );
1985:
1986: if (l_return_status = fnd_api.g_ret_sts_error) then
1987: raise fnd_api.g_exc_error;
1988: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1989: raise fnd_api.g_exc_unexpected_error;
1990: end if;
1991:
1984: );
1985:
1986: if (l_return_status = fnd_api.g_ret_sts_error) then
1987: raise fnd_api.g_exc_error;
1988: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1989: raise fnd_api.g_exc_unexpected_error;
1990: end if;
1991:
1992: elsif l_esc_contacts(j).action_code = 'I' then
1985:
1986: if (l_return_status = fnd_api.g_ret_sts_error) then
1987: raise fnd_api.g_exc_error;
1988: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
1989: raise fnd_api.g_exc_unexpected_error;
1990: end if;
1991:
1992: elsif l_esc_contacts(j).action_code = 'I' then
1993:
2001: x_msg_data => x_msg_data,
2002: x_esc_contact_id => l_escalation_contact_id,
2003: x_return_status => l_return_status);
2004:
2005: if (l_return_status = fnd_api.g_ret_sts_error) then
2006: raise fnd_api.g_exc_error;
2007: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2008: raise fnd_api.g_exc_unexpected_error;
2009: end if;
2002: x_esc_contact_id => l_escalation_contact_id,
2003: x_return_status => l_return_status);
2004:
2005: if (l_return_status = fnd_api.g_ret_sts_error) then
2006: raise fnd_api.g_exc_error;
2007: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2008: raise fnd_api.g_exc_unexpected_error;
2009: end if;
2010:
2003: x_return_status => l_return_status);
2004:
2005: if (l_return_status = fnd_api.g_ret_sts_error) then
2006: raise fnd_api.g_exc_error;
2007: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2008: raise fnd_api.g_exc_unexpected_error;
2009: end if;
2010:
2011: end if;
2004:
2005: if (l_return_status = fnd_api.g_ret_sts_error) then
2006: raise fnd_api.g_exc_error;
2007: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2008: raise fnd_api.g_exc_unexpected_error;
2009: end if;
2010:
2011: end if;
2012:
2020:
2021: jtf_ec_util.Validate_Requester(l_escalation_id,
2022: l_return_status);
2023:
2024: if l_return_status <> fnd_api.g_ret_sts_success then
2025: raise fnd_api.g_exc_error;
2026: end if;
2027:
2028: -------------------------------------------------------------------------------
2021: jtf_ec_util.Validate_Requester(l_escalation_id,
2022: l_return_status);
2023:
2024: if l_return_status <> fnd_api.g_ret_sts_success then
2025: raise fnd_api.g_exc_error;
2026: end if;
2027:
2028: -------------------------------------------------------------------------------
2029: -- Update , Insert contact points. The Deletes are done before the contacts
2043: l_escalation_id,
2044: l_escalation_contact_id,
2045: l_return_status);
2046:
2047: if (l_return_status = fnd_api.g_ret_sts_error) then
2048: raise fnd_api.g_exc_error;
2049: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2050: raise fnd_api.g_exc_unexpected_error;
2051: end if;
2044: l_escalation_contact_id,
2045: l_return_status);
2046:
2047: if (l_return_status = fnd_api.g_ret_sts_error) then
2048: raise fnd_api.g_exc_error;
2049: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2050: raise fnd_api.g_exc_unexpected_error;
2051: end if;
2052:
2045: l_return_status);
2046:
2047: if (l_return_status = fnd_api.g_ret_sts_error) then
2048: raise fnd_api.g_exc_error;
2049: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2050: raise fnd_api.g_exc_unexpected_error;
2051: end if;
2052:
2053: jtf_ec_util.Conv_Miss_Char(l_cont_points(j).attribute1);
2046:
2047: if (l_return_status = fnd_api.g_ret_sts_error) then
2048: raise fnd_api.g_exc_error;
2049: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2050: raise fnd_api.g_exc_unexpected_error;
2051: end if;
2052:
2053: jtf_ec_util.Conv_Miss_Char(l_cont_points(j).attribute1);
2054: jtf_ec_util.Conv_Miss_Char(l_cont_points(j).attribute2);
2070: -- create a phone_id for this contact
2071:
2072: Jtf_Task_Phones_Pub.create_task_phones (
2073: p_api_version => l_api_version,
2074: p_init_msg_list => fnd_api.g_false,
2075: p_commit => fnd_api.g_false,
2076: p_task_contact_id => l_escalation_contact_id,
2077: p_phone_id => l_cont_points(j).contact_point_id,
2078: x_task_phone_id => l_task_phone_id,
2071:
2072: Jtf_Task_Phones_Pub.create_task_phones (
2073: p_api_version => l_api_version,
2074: p_init_msg_list => fnd_api.g_false,
2075: p_commit => fnd_api.g_false,
2076: p_task_contact_id => l_escalation_contact_id,
2077: p_phone_id => l_cont_points(j).contact_point_id,
2078: x_task_phone_id => l_task_phone_id,
2079: x_return_status => l_return_status,
2096: p_attribute15 => l_cont_points(j).attribute15,
2097: p_attribute_category => l_cont_points(j).attribute_category
2098: );
2099:
2100: if (l_return_status = fnd_api.g_ret_sts_error) then
2101: raise fnd_api.g_exc_error;
2102: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2103: raise fnd_api.g_exc_unexpected_error;
2104: end if;
2097: p_attribute_category => l_cont_points(j).attribute_category
2098: );
2099:
2100: if (l_return_status = fnd_api.g_ret_sts_error) then
2101: raise fnd_api.g_exc_error;
2102: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2103: raise fnd_api.g_exc_unexpected_error;
2104: end if;
2105:
2098: );
2099:
2100: if (l_return_status = fnd_api.g_ret_sts_error) then
2101: raise fnd_api.g_exc_error;
2102: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2103: raise fnd_api.g_exc_unexpected_error;
2104: end if;
2105:
2106: end if;
2099:
2100: if (l_return_status = fnd_api.g_ret_sts_error) then
2101: raise fnd_api.g_exc_error;
2102: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2103: raise fnd_api.g_exc_unexpected_error;
2104: end if;
2105:
2106: end if;
2107:
2126: x_msg_data,
2127: l_note_id,
2128: l_return_status);
2129:
2130: if (l_return_status = fnd_api.g_ret_sts_error) then
2131: raise fnd_api.g_exc_error;
2132: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2133: raise fnd_api.g_exc_unexpected_error;
2134: end if;
2127: l_note_id,
2128: l_return_status);
2129:
2130: if (l_return_status = fnd_api.g_ret_sts_error) then
2131: raise fnd_api.g_exc_error;
2132: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2133: raise fnd_api.g_exc_unexpected_error;
2134: end if;
2135:
2128: l_return_status);
2129:
2130: if (l_return_status = fnd_api.g_ret_sts_error) then
2131: raise fnd_api.g_exc_error;
2132: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2133: raise fnd_api.g_exc_unexpected_error;
2134: end if;
2135:
2136: elsif l_notes(j).action_code = 'U' then
2129:
2130: if (l_return_status = fnd_api.g_ret_sts_error) then
2131: raise fnd_api.g_exc_error;
2132: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2133: raise fnd_api.g_exc_unexpected_error;
2134: end if;
2135:
2136: elsif l_notes(j).action_code = 'U' then
2137:
2142: jtf_ec_util.Validate_Note_Id(l_notes(j).note_id,
2143: l_escalation_id,
2144: l_return_status);
2145:
2146: if (l_return_status = fnd_api.g_ret_sts_error) then
2147: raise fnd_api.g_exc_error;
2148: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2149: raise fnd_api.g_exc_unexpected_error;
2150: end if;
2143: l_escalation_id,
2144: l_return_status);
2145:
2146: if (l_return_status = fnd_api.g_ret_sts_error) then
2147: raise fnd_api.g_exc_error;
2148: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2149: raise fnd_api.g_exc_unexpected_error;
2150: end if;
2151:
2144: l_return_status);
2145:
2146: if (l_return_status = fnd_api.g_ret_sts_error) then
2147: raise fnd_api.g_exc_error;
2148: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2149: raise fnd_api.g_exc_unexpected_error;
2150: end if;
2151:
2152: jtf_notes_pub.Update_note(
2145:
2146: if (l_return_status = fnd_api.g_ret_sts_error) then
2147: raise fnd_api.g_exc_error;
2148: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2149: raise fnd_api.g_exc_unexpected_error;
2150: end if;
2151:
2152: jtf_notes_pub.Update_note(
2153: p_api_version => l_api_version,
2150: end if;
2151:
2152: jtf_notes_pub.Update_note(
2153: p_api_version => l_api_version,
2154: p_init_msg_list => fnd_api.g_false,
2155: p_commit => fnd_api.g_false,
2156: x_return_status => l_return_status,
2157: x_msg_count => x_msg_count,
2158: x_msg_data => x_msg_data,
2151:
2152: jtf_notes_pub.Update_note(
2153: p_api_version => l_api_version,
2154: p_init_msg_list => fnd_api.g_false,
2155: p_commit => fnd_api.g_false,
2156: x_return_status => l_return_status,
2157: x_msg_count => x_msg_count,
2158: x_msg_data => x_msg_data,
2159: p_jtf_note_id => l_notes(j).note_id,
2165: p_last_updated_by => l_user_id,
2166: p_last_update_date => SYSDATE
2167: );
2168:
2169: if (l_return_status = fnd_api.g_ret_sts_error) then
2170: raise fnd_api.g_exc_error;
2171: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2172: raise fnd_api.g_exc_unexpected_error;
2173: end if;
2166: p_last_update_date => SYSDATE
2167: );
2168:
2169: if (l_return_status = fnd_api.g_ret_sts_error) then
2170: raise fnd_api.g_exc_error;
2171: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2172: raise fnd_api.g_exc_unexpected_error;
2173: end if;
2174:
2167: );
2168:
2169: if (l_return_status = fnd_api.g_ret_sts_error) then
2170: raise fnd_api.g_exc_error;
2171: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2172: raise fnd_api.g_exc_unexpected_error;
2173: end if;
2174:
2175: end if;
2168:
2169: if (l_return_status = fnd_api.g_ret_sts_error) then
2170: raise fnd_api.g_exc_error;
2171: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2172: raise fnd_api.g_exc_unexpected_error;
2173: end if;
2174:
2175: end if;
2176:
2179: -- Workflow
2180: -------------------------------------------------------------------------------------------------------------
2181:
2182: if l_old_owner_id <> l_esc_record.esc_owner_id
2183: and l_esc_record.esc_owner_id <> fnd_api.g_miss_num
2184: then
2185: l_owner_changed := 'Y';
2186: end if;
2187:
2185: l_owner_changed := 'Y';
2186: end if;
2187:
2188: if l_old_status_id <> l_esc_status_id
2189: and l_esc_status_id <> fnd_api.g_miss_num
2190: then
2191: l_status_changed := 'Y';
2192: end if;
2193:
2191: l_status_changed := 'Y';
2192: end if;
2193:
2194: if l_old_escalation_level <> l_esc_record.escalation_level
2195: and l_esc_record.escalation_level <> fnd_api.g_miss_char
2196: then
2197: l_level_changed := 'Y';
2198: end if;
2199:
2197: l_level_changed := 'Y';
2198: end if;
2199:
2200: if nvl(l_old_target_date, to_date('01/01/1000','DD/MM/YYYY')) <> nvl(l_esc_record.esc_target_date, to_date('01/01/1000','DD/MM/YYYY'))
2201: and nvl(l_esc_record.esc_target_date, to_date('01/01/1000','DD/MM/YYYY')) <> fnd_api.g_miss_date
2202: then
2203: l_target_date_changed := 'Y';
2204: end if;
2205:
2211: (l_status_changed='Y') OR (l_target_date_changed='Y') then
2212:
2213: JTF_EC_WORKFLOW_PKG.Start_Resc_Workflow(
2214: P_API_VERSION => l_api_version,
2215: P_INIT_MSG_LIST => fnd_api.g_false,
2216: P_COMMIT => fnd_api.g_false,
2217: X_RETURN_STATUS => l_return_status,
2218: X_MSG_COUNT => x_msg_count,
2219: X_MSG_DATA => x_msg_data,
2212:
2213: JTF_EC_WORKFLOW_PKG.Start_Resc_Workflow(
2214: P_API_VERSION => l_api_version,
2215: P_INIT_MSG_LIST => fnd_api.g_false,
2216: P_COMMIT => fnd_api.g_false,
2217: X_RETURN_STATUS => l_return_status,
2218: X_MSG_COUNT => x_msg_count,
2219: X_MSG_DATA => x_msg_data,
2220: P_TASK_ID => l_escalation_id,
2230: x_notif_not_sent => l_notif_not_sent,
2231: X_WF_PROCESS_ID => l_wf_process_id
2232: );
2233:
2234: if (l_return_status = fnd_api.g_ret_sts_error) then
2235: raise fnd_api.g_exc_error;
2236: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2237: raise fnd_api.g_exc_unexpected_error;
2238: end if;
2231: X_WF_PROCESS_ID => l_wf_process_id
2232: );
2233:
2234: if (l_return_status = fnd_api.g_ret_sts_error) then
2235: raise fnd_api.g_exc_error;
2236: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2237: raise fnd_api.g_exc_unexpected_error;
2238: end if;
2239:
2232: );
2233:
2234: if (l_return_status = fnd_api.g_ret_sts_error) then
2235: raise fnd_api.g_exc_error;
2236: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2237: raise fnd_api.g_exc_unexpected_error;
2238: end if;
2239:
2240: end if;
2233:
2234: if (l_return_status = fnd_api.g_ret_sts_error) then
2235: raise fnd_api.g_exc_error;
2236: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2237: raise fnd_api.g_exc_unexpected_error;
2238: end if;
2239:
2240: end if;
2241:
2262: x_return_status => l_return_status,
2263: x_msg_count => x_msg_count,
2264: x_msg_data => x_msg_data);
2265:
2266: if l_return_status = fnd_api.g_ret_sts_error then
2267: raise fnd_api.g_exc_error;
2268: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2269: raise fnd_api.g_exc_unexpected_error;
2270: end if;
2263: x_msg_count => x_msg_count,
2264: x_msg_data => x_msg_data);
2265:
2266: if l_return_status = fnd_api.g_ret_sts_error then
2267: raise fnd_api.g_exc_error;
2268: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2269: raise fnd_api.g_exc_unexpected_error;
2270: end if;
2271:
2264: x_msg_data => x_msg_data);
2265:
2266: if l_return_status = fnd_api.g_ret_sts_error then
2267: raise fnd_api.g_exc_error;
2268: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2269: raise fnd_api.g_exc_unexpected_error;
2270: end if;
2271:
2272: end if;
2265:
2266: if l_return_status = fnd_api.g_ret_sts_error then
2267: raise fnd_api.g_exc_error;
2268: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2269: raise fnd_api.g_exc_unexpected_error;
2270: end if;
2271:
2272: end if;
2273:
2287: x_return_status => l_return_status,
2288: x_msg_count => x_msg_count,
2289: x_msg_data => x_msg_data);
2290:
2291: if l_return_status = fnd_api.g_ret_sts_error then
2292: raise fnd_api.g_exc_error;
2293: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2294: raise fnd_api.g_exc_unexpected_error;
2295: end if;
2288: x_msg_count => x_msg_count,
2289: x_msg_data => x_msg_data);
2290:
2291: if l_return_status = fnd_api.g_ret_sts_error then
2292: raise fnd_api.g_exc_error;
2293: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2294: raise fnd_api.g_exc_unexpected_error;
2295: end if;
2296:
2289: x_msg_data => x_msg_data);
2290:
2291: if l_return_status = fnd_api.g_ret_sts_error then
2292: raise fnd_api.g_exc_error;
2293: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2294: raise fnd_api.g_exc_unexpected_error;
2295: end if;
2296:
2297: end if;
2290:
2291: if l_return_status = fnd_api.g_ret_sts_error then
2292: raise fnd_api.g_exc_error;
2293: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2294: raise fnd_api.g_exc_unexpected_error;
2295: end if;
2296:
2297: end if;
2298:
2300: x_workflow_process_id := l_wf_process_id;
2301:
2302: -- Standard check of p_commit.
2303:
2304: IF FND_API.To_Boolean( p_commit ) THEN
2305: COMMIT WORK;
2306: END IF;
2307:
2308: fnd_msg_pub.count_and_get
2311: );
2312:
2313: EXCEPTION
2314:
2315: WHEN fnd_api.g_exc_error
2316: THEN
2317: ROLLBACK TO Update_Escalation;
2318: x_return_status := fnd_api.g_ret_sts_error;
2319: fnd_msg_pub.count_and_get (
2314:
2315: WHEN fnd_api.g_exc_error
2316: THEN
2317: ROLLBACK TO Update_Escalation;
2318: x_return_status := fnd_api.g_ret_sts_error;
2319: fnd_msg_pub.count_and_get (
2320: p_count => x_msg_count,
2321: p_data => x_msg_data
2322: );
2320: p_count => x_msg_count,
2321: p_data => x_msg_data
2322: );
2323:
2324: WHEN fnd_api.g_exc_unexpected_error
2325: THEN
2326:
2327: ROLLBACK TO Update_Escalation;
2328: x_return_status := fnd_api.g_ret_sts_unexp_error;
2324: WHEN fnd_api.g_exc_unexpected_error
2325: THEN
2326:
2327: ROLLBACK TO Update_Escalation;
2328: x_return_status := fnd_api.g_ret_sts_unexp_error;
2329: fnd_msg_pub.count_and_get (
2330: p_count => x_msg_count,
2331: p_data => x_msg_data
2332: );
2333:
2334: WHEN OTHERS
2335: THEN
2336: ROLLBACK TO Update_Escalation;
2337: x_return_status := fnd_api.g_ret_sts_unexp_error;
2338: if FND_MSG_PUB.Check_Msg_Level
2339: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2340: then
2341: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, l_api_name);
2348: END UPDATE_ESCALATION;
2349:
2350: PROCEDURE DELETE_ESCALATION(
2351: p_api_version IN NUMBER,
2352: p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
2353: p_commit IN VARCHAR2 DEFAULT fnd_api.g_false,
2354: x_return_status OUT NOCOPY VARCHAR2,
2355: x_msg_count OUT NOCOPY NUMBER,
2356: x_msg_data OUT NOCOPY VARCHAR2,
2349:
2350: PROCEDURE DELETE_ESCALATION(
2351: p_api_version IN NUMBER,
2352: p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
2353: p_commit IN VARCHAR2 DEFAULT fnd_api.g_false,
2354: x_return_status OUT NOCOPY VARCHAR2,
2355: x_msg_count OUT NOCOPY NUMBER,
2356: x_msg_data OUT NOCOPY VARCHAR2,
2357: p_user_id IN NUMBER,
2376:
2377: -- Standard call to check for call compatibility.
2378:
2379:
2380: IF NOT FND_API.Compatible_API_Call ( l_api_version,
2381: p_api_version,
2382: l_api_name,
2383: G_PKG_NAME)
2384: THEN
2381: p_api_version,
2382: l_api_name,
2383: G_PKG_NAME)
2384: THEN
2385: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2386: END IF;
2387:
2388: -- Check p_init_msg_list
2389:
2386: END IF;
2387:
2388: -- Check p_init_msg_list
2389:
2390: IF FND_API.To_Boolean( p_init_msg_list ) THEN
2391: FND_MSG_PUB.initialize;
2392: END IF;
2393:
2394: -- Initialize API return status to success
2392: END IF;
2393:
2394: -- Initialize API return status to success
2395:
2396: x_return_status := FND_API.G_RET_STS_SUCCESS;
2397:
2398: --------------------------------------------------------------------------------------------
2399: -- standard customer user hook pre-processing
2400: --------------------------------------------------------------------------------------------
2407: x_return_status => l_return_status,
2408: x_msg_count => x_msg_count,
2409: x_msg_data => x_msg_data);
2410:
2411: if l_return_status = fnd_api.g_ret_sts_error then
2412: raise fnd_api.g_exc_error;
2413: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2414: raise fnd_api.g_exc_unexpected_error;
2415: end if;
2408: x_msg_count => x_msg_count,
2409: x_msg_data => x_msg_data);
2410:
2411: if l_return_status = fnd_api.g_ret_sts_error then
2412: raise fnd_api.g_exc_error;
2413: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2414: raise fnd_api.g_exc_unexpected_error;
2415: end if;
2416:
2409: x_msg_data => x_msg_data);
2410:
2411: if l_return_status = fnd_api.g_ret_sts_error then
2412: raise fnd_api.g_exc_error;
2413: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2414: raise fnd_api.g_exc_unexpected_error;
2415: end if;
2416:
2417: end if;
2410:
2411: if l_return_status = fnd_api.g_ret_sts_error then
2412: raise fnd_api.g_exc_error;
2413: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2414: raise fnd_api.g_exc_unexpected_error;
2415: end if;
2416:
2417: end if;
2418: --------------------------------------------------------------------------------------------
2427: x_return_status => l_return_status,
2428: x_msg_count => x_msg_count,
2429: x_msg_data => x_msg_data);
2430:
2431: if l_return_status = fnd_api.g_ret_sts_error then
2432: raise fnd_api.g_exc_error;
2433: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2434: raise fnd_api.g_exc_unexpected_error;
2435: end if;
2428: x_msg_count => x_msg_count,
2429: x_msg_data => x_msg_data);
2430:
2431: if l_return_status = fnd_api.g_ret_sts_error then
2432: raise fnd_api.g_exc_error;
2433: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2434: raise fnd_api.g_exc_unexpected_error;
2435: end if;
2436:
2429: x_msg_data => x_msg_data);
2430:
2431: if l_return_status = fnd_api.g_ret_sts_error then
2432: raise fnd_api.g_exc_error;
2433: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2434: raise fnd_api.g_exc_unexpected_error;
2435: end if;
2436:
2437: end if;
2430:
2431: if l_return_status = fnd_api.g_ret_sts_error then
2432: raise fnd_api.g_exc_error;
2433: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2434: raise fnd_api.g_exc_unexpected_error;
2435: end if;
2436:
2437: end if;
2438:
2447: l_user_id,
2448: l_login_id,
2449: l_return_status
2450: );
2451: if (l_return_status = fnd_api.g_ret_sts_error) then
2452: raise fnd_api.g_exc_error;
2453: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2454: raise fnd_api.g_exc_unexpected_error;
2455: end if;
2448: l_login_id,
2449: l_return_status
2450: );
2451: if (l_return_status = fnd_api.g_ret_sts_error) then
2452: raise fnd_api.g_exc_error;
2453: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2454: raise fnd_api.g_exc_unexpected_error;
2455: end if;
2456: else
2449: l_return_status
2450: );
2451: if (l_return_status = fnd_api.g_ret_sts_error) then
2452: raise fnd_api.g_exc_error;
2453: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2454: raise fnd_api.g_exc_unexpected_error;
2455: end if;
2456: else
2457: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
2450: );
2451: if (l_return_status = fnd_api.g_ret_sts_error) then
2452: raise fnd_api.g_exc_error;
2453: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2454: raise fnd_api.g_exc_unexpected_error;
2455: end if;
2456: else
2457: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
2458: raise fnd_api.g_exc_error;
2454: raise fnd_api.g_exc_unexpected_error;
2455: end if;
2456: else
2457: jtf_ec_util.Add_Invalid_Argument_Msg(l_api_name, 'NULL' ,'user_id');
2458: raise fnd_api.g_exc_error;
2459: end if;
2460:
2461: -------------------------------------------------------------------------
2462: -- Validate Escalation Task
2464: -------------------------------------------------------------------------
2465:
2466: l_return_status := 'x';
2467:
2468: if p_esc_id <> fnd_api.g_miss_num then
2469: l_escalation_id := p_esc_id;
2470: if p_esc_number <> fnd_api.g_miss_char then
2471: jtf_ec_util.add_param_ignored_msg(l_api_name, 'p_esc_number');
2472: end if;
2466: l_return_status := 'x';
2467:
2468: if p_esc_id <> fnd_api.g_miss_num then
2469: l_escalation_id := p_esc_id;
2470: if p_esc_number <> fnd_api.g_miss_char then
2471: jtf_ec_util.add_param_ignored_msg(l_api_name, 'p_esc_number');
2472: end if;
2473: elsif p_esc_number <> fnd_api.g_miss_char then
2474: l_escalation_number := p_esc_number;
2469: l_escalation_id := p_esc_id;
2470: if p_esc_number <> fnd_api.g_miss_char then
2471: jtf_ec_util.add_param_ignored_msg(l_api_name, 'p_esc_number');
2472: end if;
2473: elsif p_esc_number <> fnd_api.g_miss_char then
2474: l_escalation_number := p_esc_number;
2475: else jtf_ec_util.add_missing_param_msg(l_api_name, 'p_esc_name');
2476: end if;
2477:
2479: l_escalation_number,
2480: l_esc_task_id, -- converted number to id
2481: l_return_status);
2482:
2483: if (l_return_status = fnd_api.g_ret_sts_error) then
2484: raise fnd_api.g_exc_error;
2485: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2486: raise fnd_api.g_exc_unexpected_error;
2487: end if;
2480: l_esc_task_id, -- converted number to id
2481: l_return_status);
2482:
2483: if (l_return_status = fnd_api.g_ret_sts_error) then
2484: raise fnd_api.g_exc_error;
2485: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2486: raise fnd_api.g_exc_unexpected_error;
2487: end if;
2488:
2481: l_return_status);
2482:
2483: if (l_return_status = fnd_api.g_ret_sts_error) then
2484: raise fnd_api.g_exc_error;
2485: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2486: raise fnd_api.g_exc_unexpected_error;
2487: end if;
2488:
2489: l_escalation_id := l_esc_task_id;
2482:
2483: if (l_return_status = fnd_api.g_ret_sts_error) then
2484: raise fnd_api.g_exc_error;
2485: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2486: raise fnd_api.g_exc_unexpected_error;
2487: end if;
2488:
2489: l_escalation_id := l_esc_task_id;
2490:
2489: l_escalation_id := l_esc_task_id;
2490:
2491: JTF_EC_PVT.DELETE_ESCALATION(
2492: P_API_VERSION => l_api_version,
2493: P_INIT_MSG_LIST => fnd_api.g_false,
2494: P_COMMIT => fnd_api.g_false,
2495: P_OBJECT_VERSION_NUMBER => l_object_version_number,
2496: P_ESCALATION_ID => l_escalation_id,
2497: P_ESCALATION_NUMBER => l_escalation_number,
2490:
2491: JTF_EC_PVT.DELETE_ESCALATION(
2492: P_API_VERSION => l_api_version,
2493: P_INIT_MSG_LIST => fnd_api.g_false,
2494: P_COMMIT => fnd_api.g_false,
2495: P_OBJECT_VERSION_NUMBER => l_object_version_number,
2496: P_ESCALATION_ID => l_escalation_id,
2497: P_ESCALATION_NUMBER => l_escalation_number,
2498: X_RETURN_STATUS => l_return_status,
2498: X_RETURN_STATUS => l_return_status,
2499: X_MSG_COUNT => x_msg_count,
2500: X_MSG_DATA => x_msg_data);
2501:
2502: if (l_return_status = fnd_api.g_ret_sts_error) then
2503: raise fnd_api.g_exc_error;
2504: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2505: raise fnd_api.g_exc_unexpected_error;
2506: end if;
2499: X_MSG_COUNT => x_msg_count,
2500: X_MSG_DATA => x_msg_data);
2501:
2502: if (l_return_status = fnd_api.g_ret_sts_error) then
2503: raise fnd_api.g_exc_error;
2504: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2505: raise fnd_api.g_exc_unexpected_error;
2506: end if;
2507:
2500: X_MSG_DATA => x_msg_data);
2501:
2502: if (l_return_status = fnd_api.g_ret_sts_error) then
2503: raise fnd_api.g_exc_error;
2504: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2505: raise fnd_api.g_exc_unexpected_error;
2506: end if;
2507:
2508: --------------------------------------------------------------------------------------------
2501:
2502: if (l_return_status = fnd_api.g_ret_sts_error) then
2503: raise fnd_api.g_exc_error;
2504: elsif (l_return_status = fnd_api.g_ret_sts_unexp_error) then
2505: raise fnd_api.g_exc_unexpected_error;
2506: end if;
2507:
2508: --------------------------------------------------------------------------------------------
2509: -- standard verticle industry user hook post-processing
2517: x_return_status => l_return_status,
2518: x_msg_count => x_msg_count,
2519: x_msg_data => x_msg_data);
2520:
2521: if l_return_status = fnd_api.g_ret_sts_error then
2522: raise fnd_api.g_exc_error;
2523: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2524: raise fnd_api.g_exc_unexpected_error;
2525: end if;
2518: x_msg_count => x_msg_count,
2519: x_msg_data => x_msg_data);
2520:
2521: if l_return_status = fnd_api.g_ret_sts_error then
2522: raise fnd_api.g_exc_error;
2523: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2524: raise fnd_api.g_exc_unexpected_error;
2525: end if;
2526:
2519: x_msg_data => x_msg_data);
2520:
2521: if l_return_status = fnd_api.g_ret_sts_error then
2522: raise fnd_api.g_exc_error;
2523: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2524: raise fnd_api.g_exc_unexpected_error;
2525: end if;
2526:
2527: end if;
2520:
2521: if l_return_status = fnd_api.g_ret_sts_error then
2522: raise fnd_api.g_exc_error;
2523: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2524: raise fnd_api.g_exc_unexpected_error;
2525: end if;
2526:
2527: end if;
2528:
2539: x_return_status => l_return_status,
2540: x_msg_count => x_msg_count,
2541: x_msg_data => x_msg_data);
2542:
2543: if l_return_status = fnd_api.g_ret_sts_error then
2544: raise fnd_api.g_exc_error;
2545: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2546: raise fnd_api.g_exc_unexpected_error;
2547: end if;
2540: x_msg_count => x_msg_count,
2541: x_msg_data => x_msg_data);
2542:
2543: if l_return_status = fnd_api.g_ret_sts_error then
2544: raise fnd_api.g_exc_error;
2545: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2546: raise fnd_api.g_exc_unexpected_error;
2547: end if;
2548:
2541: x_msg_data => x_msg_data);
2542:
2543: if l_return_status = fnd_api.g_ret_sts_error then
2544: raise fnd_api.g_exc_error;
2545: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2546: raise fnd_api.g_exc_unexpected_error;
2547: end if;
2548:
2549: end if;
2542:
2543: if l_return_status = fnd_api.g_ret_sts_error then
2544: raise fnd_api.g_exc_error;
2545: elsif l_return_status = fnd_api.g_ret_sts_unexp_error then
2546: raise fnd_api.g_exc_unexpected_error;
2547: end if;
2548:
2549: end if;
2550:
2549: end if;
2550:
2551: -- Standard check of p_commit.
2552:
2553: IF FND_API.To_Boolean( p_commit ) THEN
2554: COMMIT WORK;
2555: END IF;
2556:
2557: fnd_msg_pub.count_and_get
2560: );
2561:
2562: EXCEPTION
2563:
2564: WHEN fnd_api.g_exc_error
2565: THEN
2566: ROLLBACK TO Delete_Escalation;
2567: x_return_status := fnd_api.g_ret_sts_error;
2568:
2563:
2564: WHEN fnd_api.g_exc_error
2565: THEN
2566: ROLLBACK TO Delete_Escalation;
2567: x_return_status := fnd_api.g_ret_sts_error;
2568:
2569: fnd_msg_pub.count_and_get (
2570: p_count => x_msg_count,
2571: p_data => x_msg_data
2570: p_count => x_msg_count,
2571: p_data => x_msg_data
2572: );
2573:
2574: WHEN fnd_api.g_exc_unexpected_error
2575: THEN
2576:
2577: ROLLBACK TO Delete_Escalation;
2578: x_return_status := fnd_api.g_ret_sts_unexp_error;
2574: WHEN fnd_api.g_exc_unexpected_error
2575: THEN
2576:
2577: ROLLBACK TO Delete_Escalation;
2578: x_return_status := fnd_api.g_ret_sts_unexp_error;
2579: fnd_msg_pub.count_and_get ( p_count => x_msg_count, p_data => x_msg_data);
2580:
2581: WHEN OTHERS
2582: THEN
2580:
2581: WHEN OTHERS
2582: THEN
2583: ROLLBACK TO Delete_Escalation;
2584: x_return_status := fnd_api.g_ret_sts_unexp_error;
2585:
2586: if FND_MSG_PUB.Check_Msg_Level
2587: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2588: then