27: --| HISTORY |
28: --| |
29: --==============================================================================
30: procedure CreateAssignment (p_api_version_number IN NUMBER,
31: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
32: p_commit IN VARCHAR2 := FND_API.G_FALSE,
33: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
34: p_entity in VARCHAR2,
35: p_lead_id in NUMBER,
28: --| |
29: --==============================================================================
30: procedure CreateAssignment (p_api_version_number IN NUMBER,
31: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
32: p_commit IN VARCHAR2 := FND_API.G_FALSE,
33: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
34: p_entity in VARCHAR2,
35: p_lead_id in NUMBER,
36: p_creating_username IN VARCHAR2,
29: --==============================================================================
30: procedure CreateAssignment (p_api_version_number IN NUMBER,
31: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
32: p_commit IN VARCHAR2 := FND_API.G_FALSE,
33: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
34: p_entity in VARCHAR2,
35: p_lead_id in NUMBER,
36: p_creating_username IN VARCHAR2,
37: p_assignment_type in VARCHAR2,
231:
232: BEGIN
233:
234: -- Standard call to check for call compatibility.
235: IF NOT FND_API.Compatible_API_Call(l_api_version_number,
236: p_api_version_number,
237: l_api_name,
238: G_PKG_NAME)
239: THEN
236: p_api_version_number,
237: l_api_name,
238: G_PKG_NAME)
239: THEN
240: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
241: END IF;
242:
243:
244: -- Initialize message list if p_init_msg_list is set to TRUE.
241: END IF;
242:
243:
244: -- Initialize message list if p_init_msg_list is set to TRUE.
245: IF FND_API.to_Boolean( p_init_msg_list ) THEN
246: fnd_msg_pub.initialize;
247: END IF;
248:
249: /* if fnd_profile.value('ASF_PROFILE_DEBUG_MSG_ON') = 'Y' then
248:
249: /* if fnd_profile.value('ASF_PROFILE_DEBUG_MSG_ON') = 'Y' then
250: FND_MSG_PUB.g_msg_level_threshold := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
251: else
252: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
253: end if; */
254:
255: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
256: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
258: fnd_msg_pub.Add;
259: END IF;
260:
261: -- Initialize API return status to success
262: x_return_status := FND_API.G_RET_STS_SUCCESS;
263:
264: if (p_assignment_type is NULL) or
265: (p_assignment_type NOT IN (pv_workflow_pub.g_wf_lkup_single,
266: pv_workflow_pub.g_wf_lkup_serial,
269:
270: fnd_message.SET_NAME('PV', 'PV_INVALID_ASSIGN_TYPE');
271: fnd_message.SET_TOKEN('TYPE' , p_assignment_type);
272: fnd_msg_pub.ADD;
273: raise FND_API.G_EXC_ERROR;
274:
275: end if;
276:
277: if p_bypass_cm_ok_flag is NULL then
278:
279: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
280: fnd_message.SET_TOKEN('TEXT' , 'Bypass CM OK Flag Cannot be Null');
281: fnd_msg_pub.ADD;
282: raise FND_API.G_EXC_ERROR;
283:
284: end if;
285:
286: if (p_entity is NULL) or p_entity not in ('OPPORTUNITY') then
287:
288: fnd_message.SET_NAME('PV', 'PV_INVALID_ENTITY_TYPE');
289: fnd_message.SET_TOKEN('TYPE' , p_entity);
290: fnd_msg_pub.ADD;
291: raise FND_API.G_EXC_ERROR;
292:
293: end if;
294:
295: -- --------------------------------------------------------------------------
307: fnd_message.SET_NAME('PV', 'PV_OPP_ROUTING_CLOSED_OPP');
308: fnd_message.SET_TOKEN('OPPORTUNITY_NAME' , l_entity_name);
309: fnd_message.SET_TOKEN('LEAD_ID' , p_lead_id);
310: fnd_msg_pub.ADD;
311: RAISE FND_API.G_EXC_ERROR;
312: END IF;
313: END LOOP;
314:
315:
317: if (p_partner_id_tbl.count = 0 or p_partner_id_tbl is null) then
318:
319: fnd_message.SET_NAME('PV', 'PV_NO_PRTNR_TO_ROUTE');
320: fnd_msg_pub.ADD;
321: raise FND_API.G_EXC_ERROR;
322:
323: end if;
324:
325: for i in 1..p_partner_id_tbl.count
334: if l_chk_pt_status_id is not null then
335: fnd_message.SET_NAME('PV', 'PV_ROUTING_INVALID_PARTNER');
336: --fnd_message.SET_TOKEN('TEXT', 'Status of one or more partner is inactive. Unable to initiate assignment process' );
337: fnd_msg_pub.ADD;
338: raise FND_API.G_EXC_ERROR;
339: end if;
340:
341: l_partner_id_tbl := p_partner_id_tbl;
342:
347: if l_user_category is null then
348: fnd_message.SET_NAME('PV', 'PV_INVALID_USER');
349: fnd_message.SET_TOKEN('P_USERNAME', p_creating_username);
350: fnd_msg_pub.ADD;
351: raise FND_API.G_EXC_ERROR;
352: end if;
353:
354: open lc_opportunity(pc_lead_id => p_lead_id);
355: fetch lc_opportunity into l_customer_id, l_address_id, l_lead_number, l_entity_name, l_entity_amount,
359: if l_lead_contact_id is null and fnd_profile.value('PV_OPPTY_CONTACT_REQUIRED') = 'Y' then
360:
361: fnd_message.SET_NAME('PV', 'PV_OPPTY_CONTACT_REQD');
362: fnd_msg_pub.ADD;
363: raise FND_API.G_EXC_ERROR;
364:
365: end if;
366:
367: if l_lead_number is null then
367: if l_lead_number is null then
368: fnd_message.SET_NAME('PV', 'PV_LEAD_NOT_FOUND');
369: fnd_message.SET_TOKEN('LEAD_ID', p_lead_id);
370: fnd_msg_pub.ADD;
371: raise FND_API.G_EXC_ERROR;
372: end if;
373:
374: -- ---------------------------------------------------------------------------------
375: -- Initialize record of table. This is not necessary prior to Oracle 10g.
401: if l_pt_org_party_id is null then
402: fnd_message.SET_NAME('PV', 'PV_USER_ORG_NOT_FOUND');
403: fnd_message.SET_TOKEN('P_USER_NAME' ,p_creating_username );
404: fnd_msg_pub.ADD;
405: raise FND_API.G_EXC_ERROR;
406: end if;
407:
408: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
409: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
429: fnd_msg_pub.ADD;
430: end if;
431:
432: pv_assign_util_pvt.GetWorkflowID (p_api_version_number => 1.0,
433: p_init_msg_list => FND_API.G_FALSE,
434: p_commit => FND_API.G_FALSE,
435: p_validation_level => p_validation_level,
436: p_lead_id => p_lead_id,
437: p_entity => p_entity,
430: end if;
431:
432: pv_assign_util_pvt.GetWorkflowID (p_api_version_number => 1.0,
433: p_init_msg_list => FND_API.G_FALSE,
434: p_commit => FND_API.G_FALSE,
435: p_validation_level => p_validation_level,
436: p_lead_id => p_lead_id,
437: p_entity => p_entity,
438: x_itemType => l_itemType,
442: x_return_status => x_return_status,
443: x_msg_count => x_msg_count,
444: x_msg_data => x_msg_data);
445:
446: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
447: raise FND_API.G_EXC_ERROR;
448: end if;
449:
450: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
443: x_msg_count => x_msg_count,
444: x_msg_data => x_msg_data);
445:
446: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
447: raise FND_API.G_EXC_ERROR;
448: end if;
449:
450: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
451: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
454: end if;
455:
456: pv_assignment_pvt.update_routing_stage (
457: p_api_version_number => 1.0,
458: p_init_msg_list => FND_API.G_FALSE,
459: p_commit => FND_API.G_FALSE,
460: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
461: p_itemType => l_itemtype,
462: p_itemKey => l_itemKey,
455:
456: pv_assignment_pvt.update_routing_stage (
457: p_api_version_number => 1.0,
458: p_init_msg_list => FND_API.G_FALSE,
459: p_commit => FND_API.G_FALSE,
460: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
461: p_itemType => l_itemtype,
462: p_itemKey => l_itemKey,
463: p_routing_stage => pv_assignment_pub.g_r_status_active,
456: pv_assignment_pvt.update_routing_stage (
457: p_api_version_number => 1.0,
458: p_init_msg_list => FND_API.G_FALSE,
459: p_commit => FND_API.G_FALSE,
460: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
461: p_itemType => l_itemtype,
462: p_itemKey => l_itemKey,
463: p_routing_stage => pv_assignment_pub.g_r_status_active,
464: p_active_but_open_flag => 'N',
465: x_return_status => x_return_status,
466: x_msg_count => x_msg_count,
467: x_msg_data => x_msg_data);
468:
469: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
470: raise FND_API.G_EXC_ERROR;
471: end if;
472: -- Oppty_Routing_Log Row
473:
466: x_msg_count => x_msg_count,
467: x_msg_data => x_msg_data);
468:
469: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
470: raise FND_API.G_EXC_ERROR;
471: end if;
472: -- Oppty_Routing_Log Row
473:
474:
494: if l_vad_id = p_partner_id_tbl(i) and p_assignment_type <> pv_workflow_pub.g_wf_lkup_joint then
495:
496: fnd_message.SET_NAME('PV', 'PV_SELF_ADD_JOINT_ONLY');
497: fnd_msg_pub.ADD;
498: raise FND_API.G_EXC_ERROR;
499:
500: elsif l_vad_id = p_partner_id_tbl(i) and p_assignment_type = pv_workflow_pub.g_wf_lkup_joint then
501: null;
502: else
507:
508: fnd_message.SET_NAME('PV', 'PV_NOT_INDIRECTLY_MANAGED');
509: fnd_message.SET_TOKEN('P_PARTNER_NAME' , l_pt_org_name);
510: fnd_msg_pub.ADD;
511: raise FND_API.G_EXC_ERROR;
512:
513: end if;
514: end if;
515:
518: else
519: fnd_message.SET_NAME('PV', 'PV_USER_NOT_VALID_CATEGORY');
520: fnd_message.SET_TOKEN('P_USER_NAME' ,p_creating_username);
521: fnd_msg_pub.ADD;
522: raise FND_API.G_EXC_ERROR;
523: end if; -- l_user_category = g_resource_party
524:
525: if p_assignment_type = pv_workflow_pub.g_wf_lkup_serial then
526: for v_count IN 1..l_partner_id_tbl.count loop
529: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
530: fnd_message.SET_TOKEN('TEXT' , 'Rank cannot be null for Serial Assignment');
531: fnd_msg_pub.ADD;
532:
533: raise FND_API.G_EXC_ERROR;
534: end if;
535: end loop;
536: end if; -- p_assignment_type = pv_workflow_pub.g_wf_lkup_serial
537:
543: fnd_message.SET_NAME('PV', 'PV_DEBUG_MESSAGE');
544: fnd_message.SET_TOKEN('TEXT' , 'Rank cannot be null ');
545: fnd_msg_pub.ADD;
546:
547: raise FND_API.G_EXC_ERROR;
548: end if;
549:
550: if p_rank_tbl(v_count) < p_rank_tbl(l_highest_rank_pt_row) then
551: l_highest_rank_pt_row := v_count;
579: fnd_message.SET_TOKEN('P_SOURCE_TYPE' ,p_partner_source_tbl(i));
580: fnd_message.SET_TOKEN('P_PARTNER_ID', p_partner_id_tbl(i) );
581: fnd_msg_pub.ADD;
582:
583: raise FND_API.G_EXC_ERROR;
584:
585: end if;
586:
587: end loop;
651: end if;
652:
653: pv_assign_util_pvt.UpdateAccess(
654: p_api_version_number => 1.0,
655: p_init_msg_list => FND_API.G_FALSE,
656: p_commit => FND_API.G_FALSE,
657: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
658: p_itemtype => l_itemtype,
659: p_itemkey => l_itemKey,
652:
653: pv_assign_util_pvt.UpdateAccess(
654: p_api_version_number => 1.0,
655: p_init_msg_list => FND_API.G_FALSE,
656: p_commit => FND_API.G_FALSE,
657: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
658: p_itemtype => l_itemtype,
659: p_itemkey => l_itemKey,
660: p_current_username => p_creating_username,
653: pv_assign_util_pvt.UpdateAccess(
654: p_api_version_number => 1.0,
655: p_init_msg_list => FND_API.G_FALSE,
656: p_commit => FND_API.G_FALSE,
657: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
658: p_itemtype => l_itemtype,
659: p_itemkey => l_itemKey,
660: p_current_username => p_creating_username,
661: p_lead_id => p_lead_id,
701: fnd_msg_pub.Add;
702: end if;
703:
704: pv_assign_util_pvt.GetWorkflowID (p_api_version_number => 1.0,
705: p_init_msg_list => FND_API.G_FALSE,
706: p_commit => FND_API.G_FALSE,
707: p_validation_level => p_validation_level,
708: p_lead_id => p_lead_id,
709: p_entity => p_entity,
702: end if;
703:
704: pv_assign_util_pvt.GetWorkflowID (p_api_version_number => 1.0,
705: p_init_msg_list => FND_API.G_FALSE,
706: p_commit => FND_API.G_FALSE,
707: p_validation_level => p_validation_level,
708: p_lead_id => p_lead_id,
709: p_entity => p_entity,
710: x_itemType => l_itemType,
714: x_return_status => x_return_status,
715: x_msg_count => x_msg_count,
716: x_msg_data => x_msg_data);
717:
718: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
719: raise FND_API.G_EXC_ERROR;
720: end if;
721:
722: if l_wf_status = g_wf_status_open or l_routing_status = g_r_status_active then
715: x_msg_count => x_msg_count,
716: x_msg_data => x_msg_data);
717:
718: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
719: raise FND_API.G_EXC_ERROR;
720: end if;
721:
722: if l_wf_status = g_wf_status_open or l_routing_status = g_r_status_active then
723:
729:
730: fnd_message.SET_NAME('PV', 'PV_EXISTING_WORKFLOW');
731: fnd_message.SET_TOKEN('P_LEAD_ID' ,p_lead_id);
732: fnd_msg_pub.ADD;
733: raise FND_API.G_EXC_ERROR;
734:
735: elsif l_wf_status in ('NEW', g_wf_status_closed) then
736:
737: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
762: end if;
763:
764: pv_assign_util_pvt.Create_lead_workflow_row (
765: p_api_version_number => 1.0,
766: p_init_msg_list => FND_API.G_FALSE,
767: p_commit => FND_API.G_FALSE,
768: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
769: p_workflow_rec => l_lead_workflow_rec,
770: x_ItemKey => l_itemkey,
763:
764: pv_assign_util_pvt.Create_lead_workflow_row (
765: p_api_version_number => 1.0,
766: p_init_msg_list => FND_API.G_FALSE,
767: p_commit => FND_API.G_FALSE,
768: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
769: p_workflow_rec => l_lead_workflow_rec,
770: x_ItemKey => l_itemkey,
771: x_return_status => x_return_status,
764: pv_assign_util_pvt.Create_lead_workflow_row (
765: p_api_version_number => 1.0,
766: p_init_msg_list => FND_API.G_FALSE,
767: p_commit => FND_API.G_FALSE,
768: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
769: p_workflow_rec => l_lead_workflow_rec,
770: x_ItemKey => l_itemkey,
771: x_return_status => x_return_status,
772: x_msg_count => x_msg_count,
771: x_return_status => x_return_status,
772: x_msg_count => x_msg_count,
773: x_msg_data => x_msg_data);
774:
775: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
776: raise FND_API.G_EXC_ERROR;
777: end if;
778:
779: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
772: x_msg_count => x_msg_count,
773: x_msg_data => x_msg_data);
774:
775: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
776: raise FND_API.G_EXC_ERROR;
777: end if;
778:
779: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
780: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
782: fnd_msg_pub.Add;
783: end if;
784: pv_assignment_pvt.set_current_routing_flag (
785: p_api_version_number => 1.0,
786: p_init_msg_list => FND_API.G_FALSE,
787: p_commit => FND_API.G_FALSE,
788: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
789: p_ItemKey => l_itemkey,
790: p_Entity => p_entity,
783: end if;
784: pv_assignment_pvt.set_current_routing_flag (
785: p_api_version_number => 1.0,
786: p_init_msg_list => FND_API.G_FALSE,
787: p_commit => FND_API.G_FALSE,
788: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
789: p_ItemKey => l_itemkey,
790: p_Entity => p_entity,
791: p_entity_id => p_lead_id,
784: pv_assignment_pvt.set_current_routing_flag (
785: p_api_version_number => 1.0,
786: p_init_msg_list => FND_API.G_FALSE,
787: p_commit => FND_API.G_FALSE,
788: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
789: p_ItemKey => l_itemkey,
790: p_Entity => p_entity,
791: p_entity_id => p_lead_id,
792: x_return_status => x_return_status,
792: x_return_status => x_return_status,
793: x_msg_count => x_msg_count,
794: x_msg_data => x_msg_data);
795:
796: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
797: raise FND_API.G_EXC_ERROR;
798: end if;
799:
800: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
793: x_msg_count => x_msg_count,
794: x_msg_data => x_msg_data);
795:
796: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
797: raise FND_API.G_EXC_ERROR;
798: end if;
799:
800: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
801: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
830: end if;
831:
832: pv_assignment_pvt.Create_Oppty_Routing_Log_Row (
833: p_api_version_number => 1.0,
834: p_init_msg_list => FND_API.G_FALSE,
835: p_commit => FND_API.G_FALSE,
836: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
837: P_oppty_routing_log_rec => l_oppty_routing_log_rec,
838: x_return_status => x_return_status,
831:
832: pv_assignment_pvt.Create_Oppty_Routing_Log_Row (
833: p_api_version_number => 1.0,
834: p_init_msg_list => FND_API.G_FALSE,
835: p_commit => FND_API.G_FALSE,
836: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
837: P_oppty_routing_log_rec => l_oppty_routing_log_rec,
838: x_return_status => x_return_status,
839: x_msg_count => x_msg_count,
832: pv_assignment_pvt.Create_Oppty_Routing_Log_Row (
833: p_api_version_number => 1.0,
834: p_init_msg_list => FND_API.G_FALSE,
835: p_commit => FND_API.G_FALSE,
836: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
837: P_oppty_routing_log_rec => l_oppty_routing_log_rec,
838: x_return_status => x_return_status,
839: x_msg_count => x_msg_count,
840: x_msg_data => x_msg_data);
838: x_return_status => x_return_status,
839: x_msg_count => x_msg_count,
840: x_msg_data => x_msg_data);
841:
842: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
843: RAISE FND_API.G_EXC_ERROR;
844: END IF;
845:
846: for v_count IN 1..l_partner_id_tbl.count loop
839: x_msg_count => x_msg_count,
840: x_msg_data => x_msg_data);
841:
842: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
843: RAISE FND_API.G_EXC_ERROR;
844: END IF;
845:
846: for v_count IN 1..l_partner_id_tbl.count loop
847:
861: end if;
862:
863: pv_assign_util_pvt.get_partner_info(
864: p_api_version_number => 1.0
865: ,p_init_msg_list => FND_API.G_FALSE
866: ,p_commit => FND_API.G_FALSE
867: ,p_mode => l_org_category
868: ,p_partner_id => l_partner_id_tbl(v_count)
869: ,p_entity => p_entity
862:
863: pv_assign_util_pvt.get_partner_info(
864: p_api_version_number => 1.0
865: ,p_init_msg_list => FND_API.G_FALSE
866: ,p_commit => FND_API.G_FALSE
867: ,p_mode => l_org_category
868: ,p_partner_id => l_partner_id_tbl(v_count)
869: ,p_entity => p_entity
870: ,p_entity_id => p_lead_id
874: ,x_return_status => x_return_status
875: ,x_msg_count => x_msg_count
876: ,x_msg_data => x_msg_data);
877:
878: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
879: raise FND_API.G_EXC_ERROR;
880: end if;
881:
882: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
875: ,x_msg_count => x_msg_count
876: ,x_msg_data => x_msg_data);
877:
878: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
879: raise FND_API.G_EXC_ERROR;
880: end if;
881:
882: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
883: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
922: if l_has_cm_decision_maker <> 'Y' and p_bypass_cm_ok_flag = 'N' then
923: fnd_message.SET_NAME('PV', 'PV_NO_CM_DECISION_MAKER');
924: fnd_message.SET_TOKEN('P_PARTNER_NAME' , l_pt_org_name);
925: fnd_msg_pub.ADD;
926: raise FND_API.G_EXC_ERROR;
927: end if;
928:
929: if l_has_pt_decision_maker <> 'Y' then
930: fnd_message.SET_NAME('PV', 'PV_NO_PT_DECISION_MAKER');
929: if l_has_pt_decision_maker <> 'Y' then
930: fnd_message.SET_NAME('PV', 'PV_NO_PT_DECISION_MAKER');
931: fnd_message.SET_TOKEN('P_PARTNER_NAME' , l_pt_org_name);
932: fnd_msg_pub.ADD;
933: raise FND_API.G_EXC_ERROR;
934: end if;
935:
936: end if;
937:
972: end if;
973:
974: pv_assign_util_pvt.Create_lead_assignment_row (
975: p_api_version_number => 1.0,
976: p_init_msg_list => FND_API.G_FALSE,
977: p_commit => FND_API.G_FALSE,
978: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
979: p_assignment_rec => l_assignment_rec,
980: x_lead_assignment_id => l_assignment_id,
973:
974: pv_assign_util_pvt.Create_lead_assignment_row (
975: p_api_version_number => 1.0,
976: p_init_msg_list => FND_API.G_FALSE,
977: p_commit => FND_API.G_FALSE,
978: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
979: p_assignment_rec => l_assignment_rec,
980: x_lead_assignment_id => l_assignment_id,
981: x_return_status => x_return_status ,
974: pv_assign_util_pvt.Create_lead_assignment_row (
975: p_api_version_number => 1.0,
976: p_init_msg_list => FND_API.G_FALSE,
977: p_commit => FND_API.G_FALSE,
978: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
979: p_assignment_rec => l_assignment_rec,
980: x_lead_assignment_id => l_assignment_id,
981: x_return_status => x_return_status ,
982: x_msg_count => x_msg_count ,
981: x_return_status => x_return_status ,
982: x_msg_count => x_msg_count ,
983: x_msg_data => x_msg_data);
984:
985: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
986: raise FND_API.G_EXC_ERROR;
987: end if;
988:
989: if l_rs_details_tbl.count > 0 then
982: x_msg_count => x_msg_count ,
983: x_msg_data => x_msg_data);
984:
985: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
986: raise FND_API.G_EXC_ERROR;
987: end if;
988:
989: if l_rs_details_tbl.count > 0 then
990:
1044: end if;
1045:
1046: pv_assignment_pvt.bulk_cr_party_notification(
1047: p_api_version_number => 1.0
1048: ,p_init_msg_list => FND_API.G_FALSE
1049: ,p_commit => FND_API.G_FALSE
1050: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1051: ,P_party_notify_Rec_tbl => l_party_notify_rec_tbl
1052: ,x_return_status => x_return_status
1045:
1046: pv_assignment_pvt.bulk_cr_party_notification(
1047: p_api_version_number => 1.0
1048: ,p_init_msg_list => FND_API.G_FALSE
1049: ,p_commit => FND_API.G_FALSE
1050: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1051: ,P_party_notify_Rec_tbl => l_party_notify_rec_tbl
1052: ,x_return_status => x_return_status
1053: ,x_msg_count => x_msg_count
1046: pv_assignment_pvt.bulk_cr_party_notification(
1047: p_api_version_number => 1.0
1048: ,p_init_msg_list => FND_API.G_FALSE
1049: ,p_commit => FND_API.G_FALSE
1050: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1051: ,P_party_notify_Rec_tbl => l_party_notify_rec_tbl
1052: ,x_return_status => x_return_status
1053: ,x_msg_count => x_msg_count
1054: ,x_msg_data => x_msg_data);
1052: ,x_return_status => x_return_status
1053: ,x_msg_count => x_msg_count
1054: ,x_msg_data => x_msg_data);
1055:
1056: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1057: raise FND_API.G_EXC_ERROR;
1058: end if;
1059:
1060: /************************************************************************/
1053: ,x_msg_count => x_msg_count
1054: ,x_msg_data => x_msg_data);
1055:
1056: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1057: raise FND_API.G_EXC_ERROR;
1058: end if;
1059:
1060: /************************************************************************/
1061: /* write access records for the channel managers, partners are later */
1074: end if;
1075:
1076: pv_assign_util_pvt.updateAccess (
1077: p_api_version_number => l_api_version_number,
1078: p_init_msg_list => FND_API.G_FALSE,
1079: p_commit => FND_API.G_FALSE,
1080: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1081: p_itemtype => l_itemType,
1082: p_itemkey => l_itemKey,
1075:
1076: pv_assign_util_pvt.updateAccess (
1077: p_api_version_number => l_api_version_number,
1078: p_init_msg_list => FND_API.G_FALSE,
1079: p_commit => FND_API.G_FALSE,
1080: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1081: p_itemtype => l_itemType,
1082: p_itemkey => l_itemKey,
1083: p_current_username => p_creating_username,
1076: pv_assign_util_pvt.updateAccess (
1077: p_api_version_number => l_api_version_number,
1078: p_init_msg_list => FND_API.G_FALSE,
1079: p_commit => FND_API.G_FALSE,
1080: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1081: p_itemtype => l_itemType,
1082: p_itemkey => l_itemKey,
1083: p_current_username => p_creating_username,
1084: p_lead_id => p_lead_id,
1091: x_return_status => x_return_status,
1092: x_msg_count => x_msg_count,
1093: x_msg_data => x_msg_data);
1094:
1095: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1096: raise FND_API.G_EXC_ERROR;
1097: end if;
1098:
1099: l_no_channel_mgrs := FALSE;
1092: x_msg_count => x_msg_count,
1093: x_msg_data => x_msg_data);
1094:
1095: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1096: raise FND_API.G_EXC_ERROR;
1097: end if;
1098:
1099: l_no_channel_mgrs := FALSE;
1100:
1104:
1105: if l_no_channel_mgrs then
1106: fnd_message.Set_Name('PV', 'PV_EMPTY_ROLE');
1107: fnd_msg_pub.Add;
1108: RAISE FND_API.G_EXC_ERROR;
1109: end if;
1110:
1111: open lc_get_assign_type_meaning (pc_assignment_type => p_assignment_type);
1112: fetch lc_get_assign_type_meaning into l_attrib_values_rec.assignment_type_mean;
1140: fnd_msg_pub.Add;
1141: end if;
1142:
1143: pv_assignment_pvt.StartWorkflow( p_api_version_number => 1.0,
1144: p_init_msg_list => FND_API.G_FALSE,
1145: p_commit => FND_API.G_FALSE,
1146: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1147: p_itemKey => l_itemKey,
1148: p_itemType => l_itemType,
1141: end if;
1142:
1143: pv_assignment_pvt.StartWorkflow( p_api_version_number => 1.0,
1144: p_init_msg_list => FND_API.G_FALSE,
1145: p_commit => FND_API.G_FALSE,
1146: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1147: p_itemKey => l_itemKey,
1148: p_itemType => l_itemType,
1149: p_creating_username => p_creating_username,
1142:
1143: pv_assignment_pvt.StartWorkflow( p_api_version_number => 1.0,
1144: p_init_msg_list => FND_API.G_FALSE,
1145: p_commit => FND_API.G_FALSE,
1146: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1147: p_itemKey => l_itemKey,
1148: p_itemType => l_itemType,
1149: p_creating_username => p_creating_username,
1150: p_attrib_values_rec => l_attrib_values_rec,
1151: x_return_status => x_return_status,
1152: x_msg_count => x_msg_count,
1153: x_msg_data => x_msg_data);
1154:
1155: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1156: raise FND_API.G_EXC_ERROR;
1157: end if;
1158:
1159:
1152: x_msg_count => x_msg_count,
1153: x_msg_data => x_msg_data);
1154:
1155: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1156: raise FND_API.G_EXC_ERROR;
1157: end if;
1158:
1159:
1160: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1170: end if;
1171:
1172:
1173: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
1174: ,p_init_msg_list => FND_API.G_FALSE
1175: ,p_commit => FND_API.G_FALSE
1176: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1177: ,p_itemtype => l_itemtype
1178: ,p_itemkey => l_itemkey
1171:
1172:
1173: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
1174: ,p_init_msg_list => FND_API.G_FALSE
1175: ,p_commit => FND_API.G_FALSE
1176: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1177: ,p_itemtype => l_itemtype
1178: ,p_itemkey => l_itemkey
1179: ,x_return_status => x_return_status
1172:
1173: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
1174: ,p_init_msg_list => FND_API.G_FALSE
1175: ,p_commit => FND_API.G_FALSE
1176: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1177: ,p_itemtype => l_itemtype
1178: ,p_itemkey => l_itemkey
1179: ,x_return_status => x_return_status
1180: ,x_msg_count => x_msg_count
1179: ,x_return_status => x_return_status
1180: ,x_msg_count => x_msg_count
1181: ,x_msg_data => x_msg_data);
1182:
1183: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1184: raise FND_API.G_EXC_ERROR;
1185: end if;
1186:
1187: --
1180: ,x_msg_count => x_msg_count
1181: ,x_msg_data => x_msg_data);
1182:
1183: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1184: raise FND_API.G_EXC_ERROR;
1185: end if;
1186:
1187: --
1188: -- End of API body.
1192: -- invalid wf_status. Should not happen since getworkflowid already checks for it
1193: null;
1194: end if; -- l_wf_status
1195:
1196: IF FND_API.To_Boolean ( p_commit ) THEN
1197: COMMIT WORK;
1198: END IF;
1199:
1200: -- Standard call to get message count and if count is 1, get message info.
1197: COMMIT WORK;
1198: END IF;
1199:
1200: -- Standard call to get message count and if count is 1, get message info.
1201: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1202: p_count => x_msg_count,
1203: p_data => x_msg_data);
1204:
1205: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
1201: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1202: p_count => x_msg_count,
1203: p_data => x_msg_data);
1204:
1205: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
1206:
1207: EXCEPTION
1208:
1209: WHEN FND_API.G_EXC_ERROR THEN
1205: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
1206:
1207: EXCEPTION
1208:
1209: WHEN FND_API.G_EXC_ERROR THEN
1210:
1211: x_return_status := FND_API.G_RET_STS_ERROR ;
1212: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1213: p_count => x_msg_count,
1207: EXCEPTION
1208:
1209: WHEN FND_API.G_EXC_ERROR THEN
1210:
1211: x_return_status := FND_API.G_RET_STS_ERROR ;
1212: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1213: p_count => x_msg_count,
1214: p_data => x_msg_data);
1215:
1208:
1209: WHEN FND_API.G_EXC_ERROR THEN
1210:
1211: x_return_status := FND_API.G_RET_STS_ERROR ;
1212: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1213: p_count => x_msg_count,
1214: p_data => x_msg_data);
1215:
1216: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1212: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1213: p_count => x_msg_count,
1214: p_data => x_msg_data);
1215:
1216: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1217:
1218: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1219: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1220: p_count => x_msg_count,
1214: p_data => x_msg_data);
1215:
1216: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1217:
1218: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1219: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1220: p_count => x_msg_count,
1221: p_data => x_msg_data);
1222:
1215:
1216: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1217:
1218: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1219: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1220: p_count => x_msg_count,
1221: p_data => x_msg_data);
1222:
1223: WHEN OTHERS THEN
1221: p_data => x_msg_data);
1222:
1223: WHEN OTHERS THEN
1224:
1225: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1226: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1227: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1228: p_count => x_msg_count,
1229: p_data => x_msg_data);
1223: WHEN OTHERS THEN
1224:
1225: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1226: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1227: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1228: p_count => x_msg_count,
1229: p_data => x_msg_data);
1230:
1231: end CreateAssignment;
1232:
1233:
1234: procedure process_match_response (
1235: p_api_version_number IN NUMBER,
1236: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1237: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1238: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1239: p_entity in VARCHAR2,
1240: p_user_name IN VARCHAR2,
1233:
1234: procedure process_match_response (
1235: p_api_version_number IN NUMBER,
1236: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1237: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1238: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1239: p_entity in VARCHAR2,
1240: p_user_name IN VARCHAR2,
1241: p_lead_id IN NUMBER,
1234: procedure process_match_response (
1235: p_api_version_number IN NUMBER,
1236: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1237: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1238: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1239: p_entity in VARCHAR2,
1240: p_user_name IN VARCHAR2,
1241: p_lead_id IN NUMBER,
1242: p_partyTbl in JTF_NUMBER_TABLE,
1322:
1323: begin
1324:
1325: -- Standard call to check for call compatibility.
1326: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
1327: p_api_version_number,
1328: l_api_name,
1329: G_PKG_NAME)
1330: THEN
1327: p_api_version_number,
1328: l_api_name,
1329: G_PKG_NAME)
1330: THEN
1331: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1332: END IF;
1333:
1334:
1335: -- Initialize message list if p_init_msg_list is set to TRUE.
1332: END IF;
1333:
1334:
1335: -- Initialize message list if p_init_msg_list is set to TRUE.
1336: IF FND_API.to_Boolean( p_init_msg_list )
1337: THEN
1338: fnd_msg_pub.initialize;
1339: END IF;
1340:
1340:
1341: if fnd_profile.value('ASF_PROFILE_DEBUG_MSG_ON') = 'Y' then
1342: FND_MSG_PUB.g_msg_level_threshold := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
1343: else
1344: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
1345: end if;
1346:
1347: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW)
1348: THEN
1351: fnd_msg_pub.Add;
1352: END IF;
1353:
1354: -- Initialize API return status to success
1355: x_return_status := FND_API.G_RET_STS_SUCCESS;
1356:
1357: open lc_get_assignment_type (pc_lead_id => p_lead_id, pc_entity => p_entity);
1358: fetch lc_get_assignment_type into l_assignment_type;
1359: close lc_get_assignment_type;
1366:
1367: if p_rank_tbl(i) = p_rank_tbl(j) then
1368: fnd_message.Set_Name('PV', 'PV_DUPLICATE_RANK');
1369: fnd_msg_pub.ADD;
1370: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1371: end if;
1372:
1373: end loop;
1374:
1391: if p_partyTbl.count - l_rejected_cnt > 1 then
1392:
1393: fnd_message.Set_Name('PV', 'PV_MULTIPLE_PRTNR_SINGLE');
1394: fnd_msg_pub.ADD;
1395: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1396:
1397: end if;
1398: end if;
1399: end if;
1442: END IF;
1443:
1444: pv_assignment_pvt.validateResponse (
1445: p_api_version_number => 1.0
1446: ,p_init_msg_list => FND_API.G_FALSE
1447: ,p_commit => FND_API.G_FALSE
1448: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1449: ,p_response_code => p_statusTbl(i)
1450: ,p_routing_status => l_routing_status
1443:
1444: pv_assignment_pvt.validateResponse (
1445: p_api_version_number => 1.0
1446: ,p_init_msg_list => FND_API.G_FALSE
1447: ,p_commit => FND_API.G_FALSE
1448: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1449: ,p_response_code => p_statusTbl(i)
1450: ,p_routing_status => l_routing_status
1451: ,p_decision_maker_flag => l_decision_maker_flag
1444: pv_assignment_pvt.validateResponse (
1445: p_api_version_number => 1.0
1446: ,p_init_msg_list => FND_API.G_FALSE
1447: ,p_commit => FND_API.G_FALSE
1448: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1449: ,p_response_code => p_statusTbl(i)
1450: ,p_routing_status => l_routing_status
1451: ,p_decision_maker_flag => l_decision_maker_flag
1452: ,p_notify_type => l_notify_type
1453: ,x_msg_count => x_msg_count
1454: ,x_msg_data => x_msg_data
1455: ,x_return_status => x_return_status);
1456:
1457: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1458: raise FND_API.G_EXC_ERROR;
1459: end if;
1460:
1461: if l_assignment_status <> p_statusTbl(i) then
1454: ,x_msg_data => x_msg_data
1455: ,x_return_status => x_return_status);
1456:
1457: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1458: raise FND_API.G_EXC_ERROR;
1459: end if;
1460:
1461: if l_assignment_status <> p_statusTbl(i) then
1462:
1468: END IF;
1469:
1470: pv_assignment_pvt.update_party_response (
1471: p_api_version_number => 1.0
1472: ,p_init_msg_list => FND_API.G_FALSE
1473: ,p_commit => FND_API.G_FALSE
1474: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1475: ,P_rowid => l_notify_rowid
1476: ,p_lead_assignment_id => l_assignment_id
1469:
1470: pv_assignment_pvt.update_party_response (
1471: p_api_version_number => 1.0
1472: ,p_init_msg_list => FND_API.G_FALSE
1473: ,p_commit => FND_API.G_FALSE
1474: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1475: ,P_rowid => l_notify_rowid
1476: ,p_lead_assignment_id => l_assignment_id
1477: ,p_party_resource_id => l_cm_rs_id
1470: pv_assignment_pvt.update_party_response (
1471: p_api_version_number => 1.0
1472: ,p_init_msg_list => FND_API.G_FALSE
1473: ,p_commit => FND_API.G_FALSE
1474: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1475: ,P_rowid => l_notify_rowid
1476: ,p_lead_assignment_id => l_assignment_id
1477: ,p_party_resource_id => l_cm_rs_id
1478: ,p_response => p_statusTbl(i)
1481: ,x_msg_count => x_msg_count
1482: ,x_msg_data => x_msg_data
1483: ,x_return_status => x_return_status);
1484:
1485: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1486: raise FND_API.G_EXC_ERROR;
1487: end if;
1488:
1489: IF p_statustbl(i) = g_la_status_cm_rejected THEN
1482: ,x_msg_data => x_msg_data
1483: ,x_return_status => x_return_status);
1484:
1485: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1486: raise FND_API.G_EXC_ERROR;
1487: end if;
1488:
1489: IF p_statustbl(i) = g_la_status_cm_rejected THEN
1490: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1495:
1496: PV_ASSIGN_UTIL_PVT.removePreferedPartner
1497: (
1498: p_api_version_number => 1.0,
1499: p_init_msg_list => FND_API.G_FALSE,
1500: p_commit => FND_API.G_FALSE,
1501: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1502: p_lead_id => p_lead_id,
1503: p_item_type => NULL,
1496: PV_ASSIGN_UTIL_PVT.removePreferedPartner
1497: (
1498: p_api_version_number => 1.0,
1499: p_init_msg_list => FND_API.G_FALSE,
1500: p_commit => FND_API.G_FALSE,
1501: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1502: p_lead_id => p_lead_id,
1503: p_item_type => NULL,
1504: p_item_key => NULL,
1497: (
1498: p_api_version_number => 1.0,
1499: p_init_msg_list => FND_API.G_FALSE,
1500: p_commit => FND_API.G_FALSE,
1501: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1502: p_lead_id => p_lead_id,
1503: p_item_type => NULL,
1504: p_item_key => NULL,
1505: p_partner_id => p_partyTbl(i),
1506: x_return_status => x_return_status,
1507: x_msg_count => x_msg_count,
1508: x_msg_data => x_msg_data
1509: );
1510: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1511: RAISE FND_API.G_EXC_ERROR;
1512: END IF;
1513:
1514: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1507: x_msg_count => x_msg_count,
1508: x_msg_data => x_msg_data
1509: );
1510: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1511: RAISE FND_API.G_EXC_ERROR;
1512: END IF;
1513:
1514: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1515: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1536:
1537:
1538: pv_assignment_pvt.UpdateAssignment (
1539: p_api_version_number => 1.0
1540: ,p_init_msg_list => FND_API.G_FALSE
1541: ,p_commit => FND_API.G_FALSE
1542: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1543: ,p_action => pv_assignment_pub.g_asgn_action_status_update
1544: ,p_lead_assignment_id => l_assignment_id
1537:
1538: pv_assignment_pvt.UpdateAssignment (
1539: p_api_version_number => 1.0
1540: ,p_init_msg_list => FND_API.G_FALSE
1541: ,p_commit => FND_API.G_FALSE
1542: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1543: ,p_action => pv_assignment_pub.g_asgn_action_status_update
1544: ,p_lead_assignment_id => l_assignment_id
1545: ,p_status_date => sysdate
1538: pv_assignment_pvt.UpdateAssignment (
1539: p_api_version_number => 1.0
1540: ,p_init_msg_list => FND_API.G_FALSE
1541: ,p_commit => FND_API.G_FALSE
1542: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1543: ,p_action => pv_assignment_pub.g_asgn_action_status_update
1544: ,p_lead_assignment_id => l_assignment_id
1545: ,p_status_date => sysdate
1546: ,p_status => l_response
1549: ,x_msg_count => x_msg_count
1550: ,x_msg_data => x_msg_data
1551: ,x_return_status => x_return_status);
1552:
1553: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1554: raise FND_API.G_EXC_ERROR;
1555: end if;
1556:
1557: end if;
1550: ,x_msg_data => x_msg_data
1551: ,x_return_status => x_return_status);
1552:
1553: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1554: raise FND_API.G_EXC_ERROR;
1555: end if;
1556:
1557: end if;
1558: end if;
1573: -- so instead of throwing an exception, just return
1574:
1575: -- fnd_message.set_name('PV', 'PV_NOT_DECISION_MAKER');
1576: -- fnd_msg_pub.ADD;
1577: -- RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1578: return;
1579: end if;
1580:
1581: -- check for new partners
1606:
1607:
1608: pv_assign_util_pvt.get_partner_info(
1609: p_api_version_number => 1.0
1610: ,p_init_msg_list => FND_API.G_FALSE
1611: ,p_commit => FND_API.G_FALSE
1612: ,p_mode => l_mode
1613: ,p_partner_id => p_partyTbl(i)
1614: ,p_entity => l_entity
1607:
1608: pv_assign_util_pvt.get_partner_info(
1609: p_api_version_number => 1.0
1610: ,p_init_msg_list => FND_API.G_FALSE
1611: ,p_commit => FND_API.G_FALSE
1612: ,p_mode => l_mode
1613: ,p_partner_id => p_partyTbl(i)
1614: ,p_entity => l_entity
1615: ,p_entity_id => p_lead_id
1619: ,x_return_status => x_return_status
1620: ,x_msg_count => x_msg_count
1621: ,x_msg_data => x_msg_data);
1622:
1623: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1624: raise FND_API.G_EXC_ERROR;
1625: end if;
1626:
1627: l_assignment_rec.lead_id := p_lead_id;
1620: ,x_msg_count => x_msg_count
1621: ,x_msg_data => x_msg_data);
1622:
1623: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1624: raise FND_API.G_EXC_ERROR;
1625: end if;
1626:
1627: l_assignment_rec.lead_id := p_lead_id;
1628:
1655: END IF;
1656:
1657: pv_assign_util_pvt.Create_lead_assignment_row (
1658: p_api_version_number => 1.0,
1659: p_init_msg_list => FND_API.G_FALSE,
1660: p_commit => FND_API.G_FALSE,
1661: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1662: p_assignment_rec => l_assignment_rec,
1663: x_lead_assignment_id => l_new_lead_assignment_id, -- do not overwrite l_assignment_id
1656:
1657: pv_assign_util_pvt.Create_lead_assignment_row (
1658: p_api_version_number => 1.0,
1659: p_init_msg_list => FND_API.G_FALSE,
1660: p_commit => FND_API.G_FALSE,
1661: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1662: p_assignment_rec => l_assignment_rec,
1663: x_lead_assignment_id => l_new_lead_assignment_id, -- do not overwrite l_assignment_id
1664: x_return_status => x_return_status ,
1657: pv_assign_util_pvt.Create_lead_assignment_row (
1658: p_api_version_number => 1.0,
1659: p_init_msg_list => FND_API.G_FALSE,
1660: p_commit => FND_API.G_FALSE,
1661: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1662: p_assignment_rec => l_assignment_rec,
1663: x_lead_assignment_id => l_new_lead_assignment_id, -- do not overwrite l_assignment_id
1664: x_return_status => x_return_status ,
1665: x_msg_count => x_msg_count ,
1664: x_return_status => x_return_status ,
1665: x_msg_count => x_msg_count ,
1666: x_msg_data => x_msg_data);
1667:
1668: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1669: raise FND_API.G_EXC_ERROR;
1670: end if;
1671:
1672: l_party_notify_rec_tbl.WF_ITEM_TYPE.delete;
1665: x_msg_count => x_msg_count ,
1666: x_msg_data => x_msg_data);
1667:
1668: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1669: raise FND_API.G_EXC_ERROR;
1670: end if;
1671:
1672: l_party_notify_rec_tbl.WF_ITEM_TYPE.delete;
1673: l_party_notify_rec_tbl.WF_ITEM_KEY.delete;
1720: l_party_notify_rec_tbl.DECISION_MAKER_FLAG(l_bulk_size) := 'Y';
1721:
1722: pv_assignment_pvt.bulk_cr_party_notification(
1723: p_api_version_number => 1.0
1724: ,p_init_msg_list => FND_API.G_FALSE
1725: ,p_commit => FND_API.G_FALSE
1726: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1727: ,P_party_notify_Rec_tbl => l_party_notify_rec_tbl
1728: ,x_return_status => x_return_status
1721:
1722: pv_assignment_pvt.bulk_cr_party_notification(
1723: p_api_version_number => 1.0
1724: ,p_init_msg_list => FND_API.G_FALSE
1725: ,p_commit => FND_API.G_FALSE
1726: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1727: ,P_party_notify_Rec_tbl => l_party_notify_rec_tbl
1728: ,x_return_status => x_return_status
1729: ,x_msg_count => x_msg_count
1722: pv_assignment_pvt.bulk_cr_party_notification(
1723: p_api_version_number => 1.0
1724: ,p_init_msg_list => FND_API.G_FALSE
1725: ,p_commit => FND_API.G_FALSE
1726: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1727: ,P_party_notify_Rec_tbl => l_party_notify_rec_tbl
1728: ,x_return_status => x_return_status
1729: ,x_msg_count => x_msg_count
1730: ,x_msg_data => x_msg_data);
1728: ,x_return_status => x_return_status
1729: ,x_msg_count => x_msg_count
1730: ,x_msg_data => x_msg_data);
1731:
1732: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1733: raise FND_API.G_EXC_ERROR;
1734: end if;
1735:
1736: end if;
1729: ,x_msg_count => x_msg_count
1730: ,x_msg_data => x_msg_data);
1731:
1732: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1733: raise FND_API.G_EXC_ERROR;
1734: end if;
1735:
1736: end if;
1737: end if;
1767: fnd_message.set_name('PV', 'PV_NOT_VALID_ASGNMENT_STATUS');
1768: fnd_message.set_token('P_PT_RESPONSE', l_pt_response_tbl(i));
1769: fnd_msg_pub.ADD;
1770:
1771: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1772:
1773: end if;
1774:
1775: end loop;
1800:
1801: -- For RUN mode errors, you need to check wf_item_activity_statuses
1802:
1803: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
1804: ,p_init_msg_list => FND_API.G_FALSE
1805: ,p_commit => FND_API.G_FALSE
1806: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1807: ,p_itemtype => l_itemtype
1808: ,p_itemkey => l_itemkey
1801: -- For RUN mode errors, you need to check wf_item_activity_statuses
1802:
1803: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
1804: ,p_init_msg_list => FND_API.G_FALSE
1805: ,p_commit => FND_API.G_FALSE
1806: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1807: ,p_itemtype => l_itemtype
1808: ,p_itemkey => l_itemkey
1809: ,x_return_status => x_return_status
1802:
1803: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
1804: ,p_init_msg_list => FND_API.G_FALSE
1805: ,p_commit => FND_API.G_FALSE
1806: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1807: ,p_itemtype => l_itemtype
1808: ,p_itemkey => l_itemkey
1809: ,x_return_status => x_return_status
1810: ,x_msg_count => x_msg_count
1809: ,x_return_status => x_return_status
1810: ,x_msg_count => x_msg_count
1811: ,x_msg_data => x_msg_data);
1812:
1813: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1814: raise FND_API.G_EXC_ERROR;
1815: end if;
1816:
1817: end if;
1810: ,x_msg_count => x_msg_count
1811: ,x_msg_data => x_msg_data);
1812:
1813: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1814: raise FND_API.G_EXC_ERROR;
1815: end if;
1816:
1817: end if;
1818:
1815: end if;
1816:
1817: end if;
1818:
1819: IF FND_API.To_Boolean ( p_commit ) THEN
1820: COMMIT WORK;
1821: END IF;
1822:
1823: -- Standard call to get message count and if count is 1, get message info.
1820: COMMIT WORK;
1821: END IF;
1822:
1823: -- Standard call to get message count and if count is 1, get message info.
1824: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1825: p_count => x_msg_count,
1826: p_data => x_msg_data);
1827:
1828: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
1824: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1825: p_count => x_msg_count,
1826: p_data => x_msg_data);
1827:
1828: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
1829:
1830: EXCEPTION
1831:
1832: WHEN FND_API.G_EXC_ERROR THEN
1828: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
1829:
1830: EXCEPTION
1831:
1832: WHEN FND_API.G_EXC_ERROR THEN
1833:
1834: x_return_status := FND_API.G_RET_STS_ERROR ;
1835: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1836: p_count => x_msg_count,
1830: EXCEPTION
1831:
1832: WHEN FND_API.G_EXC_ERROR THEN
1833:
1834: x_return_status := FND_API.G_RET_STS_ERROR ;
1835: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1836: p_count => x_msg_count,
1837: p_data => x_msg_data);
1838:
1831:
1832: WHEN FND_API.G_EXC_ERROR THEN
1833:
1834: x_return_status := FND_API.G_RET_STS_ERROR ;
1835: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1836: p_count => x_msg_count,
1837: p_data => x_msg_data);
1838:
1839: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1835: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1836: p_count => x_msg_count,
1837: p_data => x_msg_data);
1838:
1839: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1840:
1841: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1842: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1843: p_count => x_msg_count,
1837: p_data => x_msg_data);
1838:
1839: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1840:
1841: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1842: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1843: p_count => x_msg_count,
1844: p_data => x_msg_data);
1845:
1838:
1839: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1840:
1841: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1842: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1843: p_count => x_msg_count,
1844: p_data => x_msg_data);
1845:
1846: WHEN OTHERS THEN
1850: ELSE
1851: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1852: END IF;
1853:
1854: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1855: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1856: p_count => x_msg_count,
1857: p_data => x_msg_data);
1858:
1851: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1852: END IF;
1853:
1854: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1855: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
1856: p_count => x_msg_count,
1857: p_data => x_msg_data);
1858:
1859: end process_match_response;
1860:
1861:
1862: procedure PROCESS_OFFER_RESPONSE (
1863: p_api_version_number IN NUMBER
1864: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1865: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1866: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1867: ,p_entity in VARCHAR2
1868: ,p_lead_id IN number
1861:
1862: procedure PROCESS_OFFER_RESPONSE (
1863: p_api_version_number IN NUMBER
1864: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1865: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1866: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1867: ,p_entity in VARCHAR2
1868: ,p_lead_id IN number
1869: ,p_partner_id IN number
1862: procedure PROCESS_OFFER_RESPONSE (
1863: p_api_version_number IN NUMBER
1864: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
1865: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
1866: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
1867: ,p_entity in VARCHAR2
1868: ,p_lead_id IN number
1869: ,p_partner_id IN number
1870: ,p_user_name IN varchar2
2032: begin
2033:
2034: -- Standard call to check for call compatibility.
2035:
2036: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
2037: p_api_version_number,
2038: l_api_name,
2039: G_PKG_NAME) THEN
2040: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2036: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
2037: p_api_version_number,
2038: l_api_name,
2039: G_PKG_NAME) THEN
2040: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2041:
2042: END IF;
2043:
2044: -- Initialize message list if p_init_msg_list is set to TRUE.
2041:
2042: END IF;
2043:
2044: -- Initialize message list if p_init_msg_list is set to TRUE.
2045: IF FND_API.to_Boolean( p_init_msg_list )
2046: THEN
2047: fnd_msg_pub.initialize;
2048: END IF;
2049:
2049:
2050: if fnd_profile.value('ASF_PROFILE_DEBUG_MSG_ON') = 'Y' then
2051: FND_MSG_PUB.g_msg_level_threshold := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
2052: else
2053: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
2054: end if;
2055:
2056: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2057: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2058: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. p_pt_response=' || p_pt_response);
2059: fnd_msg_pub.Add;
2060: END IF;
2061:
2062: x_return_status := FND_API.G_RET_STS_SUCCESS ;
2063:
2064: if p_pt_response = g_la_status_cm_app_for_pt then
2065:
2066: l_user_is_cm := true;
2092: ) then
2093:
2094: fnd_message.Set_Name('PV', 'PV_PARTNER_ALREADY_ACCEPTED');
2095: fnd_msg_pub.ADD;
2096: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2097:
2098: end if;
2099:
2100: --end of bug fix
2128:
2129: fnd_message.set_Token('P_PARTNER_NAME', l_pt_org_name);
2130: fnd_msg_pub.ADD;
2131:
2132: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2133:
2134: end if;
2135:
2136: if l_wf_status = g_wf_status_closed then
2136: if l_wf_status = g_wf_status_closed then
2137: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2138: fnd_message.set_Token('TEXT', 'Routing has already completed.');
2139: fnd_msg_pub.ADD;
2140: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2141: end if;
2142:
2143: l_assignment_type := wf_engine.GetItemAttrText( itemtype => l_itemtype,
2144: itemkey => l_itemkey,
2152: fnd_message.Set_Name('PV', 'PV_NOT_VALID_ASGNMENT_TYPE');
2153: fnd_message.set_Token('P_ASGNMENT_TYPE', l_assignment_type);
2154: fnd_msg_pub.ADD;
2155:
2156: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2157:
2158: end if;
2159:
2160: -- ---------------------------------------------------------------------------
2164: -- ---------------------------------------------------------------------------
2165: IF (p_pt_response = 'PT_APPROVED' AND l_assignment_status = 'PT_REJECTED') THEN
2166: fnd_message.Set_Name('PV', 'PV_CANNOT_APPROVE_AFTER_REJECT');
2167: fnd_msg_pub.ADD;
2168: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2169: END IF;
2170:
2171:
2172:
2179: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2180: fnd_message.set_Token('TEXT', 'Not partner''s turn yet. Partner rank is ' || l_rank ||
2181: '. Current rank is ' || l_current_rank);
2182: fnd_msg_pub.ADD;
2183: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2184: end if;
2185:
2186: end if;
2187:
2192:
2193: if p_pt_response = 'PT_REJECTED' and l_routing_status = 'ACTIVE' and l_assignment_status = 'PT_APPROVED' then
2194: fnd_message.Set_Name('PV', 'PV_CANNOT_REJECT_AFTER_APPROVE');
2195: fnd_msg_pub.ADD;
2196: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2197: end if;
2198:
2199: end if;
2200:
2207:
2208:
2209: pv_assignment_pvt.validateResponse (
2210: p_api_version_number => 1.0
2211: ,p_init_msg_list => FND_API.G_FALSE
2212: ,p_commit => FND_API.G_FALSE
2213: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2214: ,p_response_code => p_pt_response
2215: ,p_routing_status => l_routing_status
2208:
2209: pv_assignment_pvt.validateResponse (
2210: p_api_version_number => 1.0
2211: ,p_init_msg_list => FND_API.G_FALSE
2212: ,p_commit => FND_API.G_FALSE
2213: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2214: ,p_response_code => p_pt_response
2215: ,p_routing_status => l_routing_status
2216: ,p_decision_maker_flag => l_decision_maker_flag
2209: pv_assignment_pvt.validateResponse (
2210: p_api_version_number => 1.0
2211: ,p_init_msg_list => FND_API.G_FALSE
2212: ,p_commit => FND_API.G_FALSE
2213: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2214: ,p_response_code => p_pt_response
2215: ,p_routing_status => l_routing_status
2216: ,p_decision_maker_flag => l_decision_maker_flag
2217: ,p_notify_type => g_notify_type_offered_to
2218: ,x_msg_count => x_msg_count
2219: ,x_msg_data => x_msg_data
2220: ,x_return_status => x_return_status);
2221:
2222: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2223: raise FND_API.G_EXC_ERROR;
2224: end if;
2225:
2226: if p_pt_response = g_la_status_pt_rejected then
2219: ,x_msg_data => x_msg_data
2220: ,x_return_status => x_return_status);
2221:
2222: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2223: raise FND_API.G_EXC_ERROR;
2224: end if;
2225:
2226: if p_pt_response = g_la_status_pt_rejected then
2227:
2228: if p_reason_code is NULL then
2229: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2230: fnd_message.set_Token('TEXT', 'Must specify decline reason');
2231: fnd_msg_pub.ADD;
2232: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2233: else
2234: open lc_validate_reason (pc_lookup_type => 'PV_REASON_CODES', pc_reason_code => p_reason_code);
2235: fetch lc_validate_reason into l_reason_code;
2236: close lc_validate_reason;
2238: if l_reason_code is NULL then
2239: fnd_message.Set_Name('PV', 'PV_NOT_VALID_REASON_CODE');
2240: fnd_message.set_Token('P_REASON_CODE', p_reason_code);
2241: fnd_msg_pub.ADD;
2242: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2243: end if;
2244:
2245: end if;
2246:
2249: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2250: fnd_message.set_Token('TEXT', 'Cannot have decline reason when accepting offer');
2251: fnd_msg_pub.ADD;
2252:
2253: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2254:
2255: end if;
2256:
2257: if l_user_is_cm then
2276:
2277:
2278: pv_assign_util_pvt.create_party_notification(
2279: p_api_version_number => 1.0
2280: ,p_init_msg_list => FND_API.G_FALSE
2281: ,p_commit => FND_API.G_FALSE
2282: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2283: ,P_party_notify_Rec => l_party_notify_rec
2284: ,x_party_notification_id => l_party_notification_id
2277:
2278: pv_assign_util_pvt.create_party_notification(
2279: p_api_version_number => 1.0
2280: ,p_init_msg_list => FND_API.G_FALSE
2281: ,p_commit => FND_API.G_FALSE
2282: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2283: ,P_party_notify_Rec => l_party_notify_rec
2284: ,x_party_notification_id => l_party_notification_id
2285: ,x_return_status => x_return_status
2278: pv_assign_util_pvt.create_party_notification(
2279: p_api_version_number => 1.0
2280: ,p_init_msg_list => FND_API.G_FALSE
2281: ,p_commit => FND_API.G_FALSE
2282: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2283: ,P_party_notify_Rec => l_party_notify_rec
2284: ,x_party_notification_id => l_party_notification_id
2285: ,x_return_status => x_return_status
2286: ,x_msg_count => x_msg_count
2285: ,x_return_status => x_return_status
2286: ,x_msg_count => x_msg_count
2287: ,x_msg_data => x_msg_data);
2288:
2289: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2290: raise FND_API.G_EXC_ERROR;
2291: end if;
2292:
2293: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW)
2286: ,x_msg_count => x_msg_count
2287: ,x_msg_data => x_msg_data);
2288:
2289: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2290: raise FND_API.G_EXC_ERROR;
2291: end if;
2292:
2293: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW)
2294: THEN
2298: END IF;
2299:
2300: pv_assignment_pvt.UpdateAssignment (
2301: p_api_version_number => 1.0
2302: ,p_init_msg_list => FND_API.G_FALSE
2303: ,p_commit => FND_API.G_FALSE
2304: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2305: ,p_action => g_asgn_action_status_update
2306: ,p_lead_assignment_id => l_assignment_id
2299:
2300: pv_assignment_pvt.UpdateAssignment (
2301: p_api_version_number => 1.0
2302: ,p_init_msg_list => FND_API.G_FALSE
2303: ,p_commit => FND_API.G_FALSE
2304: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2305: ,p_action => g_asgn_action_status_update
2306: ,p_lead_assignment_id => l_assignment_id
2307: ,p_status_date => sysdate
2300: pv_assignment_pvt.UpdateAssignment (
2301: p_api_version_number => 1.0
2302: ,p_init_msg_list => FND_API.G_FALSE
2303: ,p_commit => FND_API.G_FALSE
2304: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2305: ,p_action => g_asgn_action_status_update
2306: ,p_lead_assignment_id => l_assignment_id
2307: ,p_status_date => sysdate
2308: ,p_status => p_pt_response
2311: ,x_msg_count => x_msg_count
2312: ,x_msg_data => x_msg_data
2313: ,x_return_status => x_return_status);
2314:
2315: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2316: raise FND_API.G_EXC_ERROR;
2317: end if;
2318:
2319: else
2312: ,x_msg_data => x_msg_data
2313: ,x_return_status => x_return_status);
2314:
2315: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2316: raise FND_API.G_EXC_ERROR;
2317: end if;
2318:
2319: else
2320:
2326: END IF;
2327:
2328: pv_assignment_pvt.update_party_response (
2329: p_api_version_number => 1.0
2330: ,p_init_msg_list => FND_API.G_FALSE
2331: ,p_commit => FND_API.G_FALSE
2332: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2333: ,P_rowid => l_notify_rowid
2334: ,p_lead_assignment_id => l_assignment_id
2327:
2328: pv_assignment_pvt.update_party_response (
2329: p_api_version_number => 1.0
2330: ,p_init_msg_list => FND_API.G_FALSE
2331: ,p_commit => FND_API.G_FALSE
2332: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2333: ,P_rowid => l_notify_rowid
2334: ,p_lead_assignment_id => l_assignment_id
2335: ,p_party_resource_id => l_responder_rs_id
2328: pv_assignment_pvt.update_party_response (
2329: p_api_version_number => 1.0
2330: ,p_init_msg_list => FND_API.G_FALSE
2331: ,p_commit => FND_API.G_FALSE
2332: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2333: ,P_rowid => l_notify_rowid
2334: ,p_lead_assignment_id => l_assignment_id
2335: ,p_party_resource_id => l_responder_rs_id
2336: ,p_response => p_pt_response
2339: ,x_msg_count => x_msg_count
2340: ,x_msg_data => x_msg_data
2341: ,x_return_status => x_return_status);
2342:
2343: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2344: raise FND_API.G_EXC_ERROR;
2345: end if;
2346: end if;
2347:
2340: ,x_msg_data => x_msg_data
2341: ,x_return_status => x_return_status);
2342:
2343: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2344: raise FND_API.G_EXC_ERROR;
2345: end if;
2346: end if;
2347:
2348: l_customer_id := wf_engine.GetItemAttrNumber( itemtype => l_itemtype,
2373: END IF;
2374:
2375: pv_assignment_pvt.update_routing_stage (
2376: p_api_version_number => 1.0,
2377: p_init_msg_list => FND_API.G_FALSE,
2378: p_commit => FND_API.G_FALSE,
2379: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2380: p_itemType => l_itemtype,
2381: p_itemKey => l_itemKey,
2374:
2375: pv_assignment_pvt.update_routing_stage (
2376: p_api_version_number => 1.0,
2377: p_init_msg_list => FND_API.G_FALSE,
2378: p_commit => FND_API.G_FALSE,
2379: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2380: p_itemType => l_itemtype,
2381: p_itemKey => l_itemKey,
2382: p_routing_stage => pv_assignment_pub.g_r_status_active,
2375: pv_assignment_pvt.update_routing_stage (
2376: p_api_version_number => 1.0,
2377: p_init_msg_list => FND_API.G_FALSE,
2378: p_commit => FND_API.G_FALSE,
2379: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2380: p_itemType => l_itemtype,
2381: p_itemKey => l_itemKey,
2382: p_routing_stage => pv_assignment_pub.g_r_status_active,
2383: p_active_but_open_flag => 'Y',
2384: x_return_status => x_return_status,
2385: x_msg_count => x_msg_count,
2386: x_msg_data => x_msg_data);
2387:
2388: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2389: raise FND_API.G_EXC_ERROR;
2390: end if;
2391:
2392: end if;
2385: x_msg_count => x_msg_count,
2386: x_msg_data => x_msg_data);
2387:
2388: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2389: raise FND_API.G_EXC_ERROR;
2390: end if;
2391:
2392: end if;
2393:
2448:
2449: PV_ASSIGN_UTIL_PVT.removePreferedPartner
2450: (
2451: p_api_version_number => 1.0,
2452: p_init_msg_list => FND_API.G_FALSE,
2453: p_commit => FND_API.G_FALSE,
2454: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2455: p_lead_id => p_lead_id,
2456: p_item_type => NULL,
2449: PV_ASSIGN_UTIL_PVT.removePreferedPartner
2450: (
2451: p_api_version_number => 1.0,
2452: p_init_msg_list => FND_API.G_FALSE,
2453: p_commit => FND_API.G_FALSE,
2454: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2455: p_lead_id => p_lead_id,
2456: p_item_type => NULL,
2457: p_item_key => NULL,
2450: (
2451: p_api_version_number => 1.0,
2452: p_init_msg_list => FND_API.G_FALSE,
2453: p_commit => FND_API.G_FALSE,
2454: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2455: p_lead_id => p_lead_id,
2456: p_item_type => NULL,
2457: p_item_key => NULL,
2458: p_partner_id => p_partner_id,
2459: x_return_status => x_return_status,
2460: x_msg_count => x_msg_count,
2461: x_msg_data => x_msg_data
2462: );
2463: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2464: RAISE FND_API.G_EXC_ERROR;
2465: END IF;
2466:
2467: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2460: x_msg_count => x_msg_count,
2461: x_msg_data => x_msg_data
2462: );
2463: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2464: RAISE FND_API.G_EXC_ERROR;
2465: END IF;
2466:
2467: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2468: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2480: END IF;
2481:
2482: pv_assign_util_pvt.updateAccess(
2483: p_api_version_number => 1.0,
2484: p_init_msg_list => FND_API.G_FALSE,
2485: p_commit => FND_API.G_FALSE,
2486: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2487: p_itemtype => l_itemType,
2488: p_itemkey => l_itemKey,
2481:
2482: pv_assign_util_pvt.updateAccess(
2483: p_api_version_number => 1.0,
2484: p_init_msg_list => FND_API.G_FALSE,
2485: p_commit => FND_API.G_FALSE,
2486: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2487: p_itemtype => l_itemType,
2488: p_itemkey => l_itemKey,
2489: p_current_username => l_username_tab(i),
2482: pv_assign_util_pvt.updateAccess(
2483: p_api_version_number => 1.0,
2484: p_init_msg_list => FND_API.G_FALSE,
2485: p_commit => FND_API.G_FALSE,
2486: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2487: p_itemtype => l_itemType,
2488: p_itemkey => l_itemKey,
2489: p_current_username => l_username_tab(i),
2490: p_lead_id => p_lead_id,
2497: x_return_status => x_return_status,
2498: x_msg_count => x_msg_count,
2499: x_msg_data => x_msg_data);
2500:
2501: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2502: raise FND_API.G_EXC_ERROR;
2503: end if;
2504:
2505: end loop;
2498: x_msg_count => x_msg_count,
2499: x_msg_data => x_msg_data);
2500:
2501: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2502: raise FND_API.G_EXC_ERROR;
2503: end if;
2504:
2505: end loop;
2506:
2520: END IF;
2521:
2522: pv_assign_util_pvt.updateaccess(
2523: p_api_version_number => 1.0,
2524: p_init_msg_list => FND_API.G_FALSE,
2525: p_commit => FND_API.G_FALSE,
2526: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2527: p_itemtype => l_itemType,
2528: p_itemkey => l_itemKey,
2521:
2522: pv_assign_util_pvt.updateaccess(
2523: p_api_version_number => 1.0,
2524: p_init_msg_list => FND_API.G_FALSE,
2525: p_commit => FND_API.G_FALSE,
2526: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2527: p_itemtype => l_itemType,
2528: p_itemkey => l_itemKey,
2529: p_current_username => NULL,
2522: pv_assign_util_pvt.updateaccess(
2523: p_api_version_number => 1.0,
2524: p_init_msg_list => FND_API.G_FALSE,
2525: p_commit => FND_API.G_FALSE,
2526: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2527: p_itemtype => l_itemType,
2528: p_itemkey => l_itemKey,
2529: p_current_username => NULL,
2530: p_lead_id => p_lead_id,
2537: x_return_status => x_return_status,
2538: x_msg_count => x_msg_count,
2539: x_msg_data => x_msg_data);
2540:
2541: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2542: raise FND_API.G_EXC_ERROR;
2543: end if;
2544:
2545: end loop;
2538: x_msg_count => x_msg_count,
2539: x_msg_data => x_msg_data);
2540:
2541: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2542: raise FND_API.G_EXC_ERROR;
2543: end if;
2544:
2545: end loop;
2546: close lc_get_pt_org;
2570: for i in 1 .. l_username_tab.count loop
2571:
2572: pv_assign_util_pvt.updateAccess(
2573: p_api_version_number => 1.0,
2574: p_init_msg_list => FND_API.G_FALSE,
2575: p_commit => FND_API.G_FALSE,
2576: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2577: p_itemtype => l_itemType,
2578: p_itemkey => l_itemKey,
2571:
2572: pv_assign_util_pvt.updateAccess(
2573: p_api_version_number => 1.0,
2574: p_init_msg_list => FND_API.G_FALSE,
2575: p_commit => FND_API.G_FALSE,
2576: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2577: p_itemtype => l_itemType,
2578: p_itemkey => l_itemKey,
2579: p_current_username => l_username_tab(i),
2572: pv_assign_util_pvt.updateAccess(
2573: p_api_version_number => 1.0,
2574: p_init_msg_list => FND_API.G_FALSE,
2575: p_commit => FND_API.G_FALSE,
2576: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2577: p_itemtype => l_itemType,
2578: p_itemkey => l_itemKey,
2579: p_current_username => l_username_tab(i),
2580: p_lead_id => p_lead_id,
2587: x_return_status => x_return_status,
2588: x_msg_count => x_msg_count,
2589: x_msg_data => x_msg_data);
2590:
2591: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2592: raise FND_API.G_EXC_ERROR;
2593: end if;
2594:
2595: end loop;
2588: x_msg_count => x_msg_count,
2589: x_msg_data => x_msg_data);
2590:
2591: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2592: raise FND_API.G_EXC_ERROR;
2593: end if;
2594:
2595: end loop;
2596:
2663: aname => pv_workflow_pub.g_wf_attr_wf_activity_id);
2664:
2665: pv_assignment_pvt.send_notification (
2666: p_api_version_number => 1.0
2667: ,p_init_msg_list => FND_API.G_FALSE
2668: ,p_commit => FND_API.G_FALSE
2669: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2670: ,p_itemtype => l_itemtype
2671: ,p_itemkey => l_itemkey
2664:
2665: pv_assignment_pvt.send_notification (
2666: p_api_version_number => 1.0
2667: ,p_init_msg_list => FND_API.G_FALSE
2668: ,p_commit => FND_API.G_FALSE
2669: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2670: ,p_itemtype => l_itemtype
2671: ,p_itemkey => l_itemkey
2672: ,p_activity_id => l_wf_activity_id
2665: pv_assignment_pvt.send_notification (
2666: p_api_version_number => 1.0
2667: ,p_init_msg_list => FND_API.G_FALSE
2668: ,p_commit => FND_API.G_FALSE
2669: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2670: ,p_itemtype => l_itemtype
2671: ,p_itemkey => l_itemkey
2672: ,p_activity_id => l_wf_activity_id
2673: ,P_route_stage => g_r_status_offered
2675: ,x_return_status => x_return_status
2676: ,x_msg_count => x_msg_count
2677: ,x_msg_data => x_msg_data);
2678:
2679: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2680: raise FND_API.G_EXC_ERROR;
2681: end if;
2682:
2683: -- For RUN mode errors, you need to check wf_item_activity_statuses
2676: ,x_msg_count => x_msg_count
2677: ,x_msg_data => x_msg_data);
2678:
2679: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2680: raise FND_API.G_EXC_ERROR;
2681: end if;
2682:
2683: -- For RUN mode errors, you need to check wf_item_activity_statuses
2684:
2682:
2683: -- For RUN mode errors, you need to check wf_item_activity_statuses
2684:
2685: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
2686: ,p_init_msg_list => FND_API.G_FALSE
2687: ,p_commit => FND_API.G_FALSE
2688: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2689: ,p_itemtype => l_itemtype
2690: ,p_itemkey => l_itemkey
2683: -- For RUN mode errors, you need to check wf_item_activity_statuses
2684:
2685: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
2686: ,p_init_msg_list => FND_API.G_FALSE
2687: ,p_commit => FND_API.G_FALSE
2688: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2689: ,p_itemtype => l_itemtype
2690: ,p_itemkey => l_itemkey
2691: ,x_return_status => x_return_status
2684:
2685: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
2686: ,p_init_msg_list => FND_API.G_FALSE
2687: ,p_commit => FND_API.G_FALSE
2688: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2689: ,p_itemtype => l_itemtype
2690: ,p_itemkey => l_itemkey
2691: ,x_return_status => x_return_status
2692: ,x_msg_count => x_msg_count
2691: ,x_return_status => x_return_status
2692: ,x_msg_count => x_msg_count
2693: ,x_msg_data => x_msg_data);
2694:
2695: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2696: raise FND_API.G_EXC_ERROR;
2697: end if;
2698:
2699:
2692: ,x_msg_count => x_msg_count
2693: ,x_msg_data => x_msg_data);
2694:
2695: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2696: raise FND_API.G_EXC_ERROR;
2697: end if;
2698:
2699:
2700: IF FND_API.To_Boolean ( p_commit ) THEN
2696: raise FND_API.G_EXC_ERROR;
2697: end if;
2698:
2699:
2700: IF FND_API.To_Boolean ( p_commit ) THEN
2701: COMMIT WORK;
2702: END IF;
2703:
2704: -- Standard call to get message count and if count is 1, get message info.
2701: COMMIT WORK;
2702: END IF;
2703:
2704: -- Standard call to get message count and if count is 1, get message info.
2705: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2706: p_count => x_msg_count,
2707: p_data => x_msg_data);
2708:
2709: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
2705: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2706: p_count => x_msg_count,
2707: p_data => x_msg_data);
2708:
2709: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
2710:
2711: EXCEPTION
2712: WHEN g_e_resource_busy THEN
2713: -- --------------------------------------------------------------------
2718: -- --------------------------------------------------------------------
2719: fnd_message.Set_Name('PV', 'PV_REQUERY_THE_RECORD');
2720: fnd_msg_pub.ADD;
2721:
2722: x_return_status := FND_API.G_RET_STS_ERROR;
2723: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2724: p_count => x_msg_count,
2725: p_data => x_msg_data);
2726:
2719: fnd_message.Set_Name('PV', 'PV_REQUERY_THE_RECORD');
2720: fnd_msg_pub.ADD;
2721:
2722: x_return_status := FND_API.G_RET_STS_ERROR;
2723: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2724: p_count => x_msg_count,
2725: p_data => x_msg_data);
2726:
2727:
2724: p_count => x_msg_count,
2725: p_data => x_msg_data);
2726:
2727:
2728: WHEN FND_API.G_EXC_ERROR THEN
2729:
2730: x_return_status := FND_API.G_RET_STS_ERROR ;
2731: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2732: p_count => x_msg_count,
2726:
2727:
2728: WHEN FND_API.G_EXC_ERROR THEN
2729:
2730: x_return_status := FND_API.G_RET_STS_ERROR ;
2731: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2732: p_count => x_msg_count,
2733: p_data => x_msg_data);
2734:
2727:
2728: WHEN FND_API.G_EXC_ERROR THEN
2729:
2730: x_return_status := FND_API.G_RET_STS_ERROR ;
2731: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2732: p_count => x_msg_count,
2733: p_data => x_msg_data);
2734:
2735: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2731: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2732: p_count => x_msg_count,
2733: p_data => x_msg_data);
2734:
2735: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2736: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2737: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2738: p_count => x_msg_count,
2739: p_data => x_msg_data);
2732: p_count => x_msg_count,
2733: p_data => x_msg_data);
2734:
2735: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2736: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2737: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2738: p_count => x_msg_count,
2739: p_data => x_msg_data);
2740:
2733: p_data => x_msg_data);
2734:
2735: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2736: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2737: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2738: p_count => x_msg_count,
2739: p_data => x_msg_data);
2740:
2741: WHEN OTHERS THEN
2745: ELSE
2746: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2747: END IF;
2748:
2749: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2750: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2751: p_count => x_msg_count,
2752: p_data => x_msg_data);
2753:
2746: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2747: END IF;
2748:
2749: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2750: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
2751: p_count => x_msg_count,
2752: p_data => x_msg_data);
2753:
2754: end PROCESS_OFFER_RESPONSE;
2756:
2757:
2758: procedure WITHDRAW_ASSIGNMENT (
2759: p_api_version_number IN NUMBER
2760: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
2761: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
2762: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
2763: ,p_entity in VARCHAR2
2764: ,p_lead_id IN NUMBER
2757:
2758: procedure WITHDRAW_ASSIGNMENT (
2759: p_api_version_number IN NUMBER
2760: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
2761: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
2762: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
2763: ,p_entity in VARCHAR2
2764: ,p_lead_id IN NUMBER
2765: ,p_user_name IN VARCHAR2
2758: procedure WITHDRAW_ASSIGNMENT (
2759: p_api_version_number IN NUMBER
2760: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
2761: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
2762: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
2763: ,p_entity in VARCHAR2
2764: ,p_lead_id IN NUMBER
2765: ,p_user_name IN VARCHAR2
2766: ,x_return_status OUT NOCOPY VARCHAR2
2898: begin
2899:
2900: -- Standard call to check for call compatibility.
2901:
2902: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
2903: p_api_version_number,
2904: l_api_name,
2905: G_PKG_NAME) THEN
2906: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2902: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
2903: p_api_version_number,
2904: l_api_name,
2905: G_PKG_NAME) THEN
2906: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2907:
2908: END IF;
2909:
2910: -- Initialize message list if p_init_msg_list is set to TRUE.
2907:
2908: END IF;
2909:
2910: -- Initialize message list if p_init_msg_list is set to TRUE.
2911: IF FND_API.to_Boolean( p_init_msg_list )
2912: THEN
2913: fnd_msg_pub.initialize;
2914: END IF;
2915:
2915:
2916: /* if fnd_profile.value('ASF_PROFILE_DEBUG_MSG_ON') = 'Y' then
2917: FND_MSG_PUB.g_msg_level_threshold := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
2918: else
2919: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
2920: end if; */
2921:
2922: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2923: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
2924: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Lead id =' || p_lead_id);
2925: fnd_msg_pub.Add;
2926: END IF;
2927:
2928: x_return_status := FND_API.G_RET_STS_SUCCESS ;
2929:
2930:
2931: open lc_get_routing_stage (pc_lead_id => p_lead_id, pc_entity => p_entity);
2932:
2968: fnd_message.Set_Name('PV', 'PV_NO_ASGNMENT');
2969: fnd_message.set_token('P_LEAD_ID', p_lead_id);
2970: fnd_msg_pub.ADD;
2971:
2972: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2973:
2974: elsif l_routing_stage in (g_r_status_matched, g_r_status_offered) then
2975:
2976: l_rank := wf_engine.GetItemAttrNumber( itemtype => l_itemtype,
3081: END IF;
3082:
3083: pv_assignment_pvt.UpdateAssignment (
3084: p_api_version_number => 1.0
3085: ,p_init_msg_list => FND_API.G_FALSE
3086: ,p_commit => FND_API.G_FALSE
3087: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3088: ,p_action => g_asgn_action_status_update
3089: ,p_lead_assignment_id => l_assignment_id_tbl(i)
3082:
3083: pv_assignment_pvt.UpdateAssignment (
3084: p_api_version_number => 1.0
3085: ,p_init_msg_list => FND_API.G_FALSE
3086: ,p_commit => FND_API.G_FALSE
3087: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3088: ,p_action => g_asgn_action_status_update
3089: ,p_lead_assignment_id => l_assignment_id_tbl(i)
3090: ,p_status_date => sysdate
3083: pv_assignment_pvt.UpdateAssignment (
3084: p_api_version_number => 1.0
3085: ,p_init_msg_list => FND_API.G_FALSE
3086: ,p_commit => FND_API.G_FALSE
3087: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3088: ,p_action => g_asgn_action_status_update
3089: ,p_lead_assignment_id => l_assignment_id_tbl(i)
3090: ,p_status_date => sysdate
3091: ,p_status => l_assignment_status
3094: ,x_msg_count => x_msg_count
3095: ,x_msg_data => x_msg_data
3096: ,x_return_status => x_return_status);
3097:
3098: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3099: raise FND_API.G_EXC_ERROR;
3100: end if;
3101:
3102: end loop;
3095: ,x_msg_data => x_msg_data
3096: ,x_return_status => x_return_status);
3097:
3098: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3099: raise FND_API.G_EXC_ERROR;
3100: end if;
3101:
3102: end loop;
3103:
3129:
3130: fnd_message.Set_Name('PV', 'PV_NO_WITHDRAW_RIGHTS');
3131: fnd_message.Set_Token('P_USERNAME', p_user_name);
3132: fnd_msg_pub.ADD;
3133: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3134:
3135: end if;
3136:
3137: l_party_notify_rec.WF_ITEM_TYPE := l_itemtype;
3146: l_party_notify_rec.DECISION_MAKER_FLAG := 'Y';
3147:
3148: pv_assign_util_pvt.create_party_notification(
3149: p_api_version_number => 1.0
3150: ,p_init_msg_list => FND_API.G_FALSE
3151: ,p_commit => FND_API.G_FALSE
3152: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3153: ,P_party_notify_Rec => l_party_notify_rec
3154: ,x_party_notification_id => l_party_notification_id
3147:
3148: pv_assign_util_pvt.create_party_notification(
3149: p_api_version_number => 1.0
3150: ,p_init_msg_list => FND_API.G_FALSE
3151: ,p_commit => FND_API.G_FALSE
3152: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3153: ,P_party_notify_Rec => l_party_notify_rec
3154: ,x_party_notification_id => l_party_notification_id
3155: ,x_return_status => x_return_status
3148: pv_assign_util_pvt.create_party_notification(
3149: p_api_version_number => 1.0
3150: ,p_init_msg_list => FND_API.G_FALSE
3151: ,p_commit => FND_API.G_FALSE
3152: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3153: ,P_party_notify_Rec => l_party_notify_rec
3154: ,x_party_notification_id => l_party_notification_id
3155: ,x_return_status => x_return_status
3156: ,x_msg_count => x_msg_count
3155: ,x_return_status => x_return_status
3156: ,x_msg_count => x_msg_count
3157: ,x_msg_data => x_msg_data);
3158:
3159: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3160: raise FND_API.G_EXC_ERROR;
3161: end if; */
3162:
3163: for i in 1 .. l_assignment_id_tbl.count loop
3156: ,x_msg_count => x_msg_count
3157: ,x_msg_data => x_msg_data);
3158:
3159: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3160: raise FND_API.G_EXC_ERROR;
3161: end if; */
3162:
3163: for i in 1 .. l_assignment_id_tbl.count loop
3164:
3169: END IF;
3170:
3171: pv_assignment_pvt.UpdateAssignment (
3172: p_api_version_number => 1.0
3173: ,p_init_msg_list => FND_API.G_FALSE
3174: ,p_commit => FND_API.G_FALSE
3175: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3176: ,p_action => g_asgn_action_status_update
3177: ,p_lead_assignment_id => l_assignment_id_tbl(i) -- l_lead_assignment_id
3170:
3171: pv_assignment_pvt.UpdateAssignment (
3172: p_api_version_number => 1.0
3173: ,p_init_msg_list => FND_API.G_FALSE
3174: ,p_commit => FND_API.G_FALSE
3175: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3176: ,p_action => g_asgn_action_status_update
3177: ,p_lead_assignment_id => l_assignment_id_tbl(i) -- l_lead_assignment_id
3178: ,p_status_date => sysdate
3171: pv_assignment_pvt.UpdateAssignment (
3172: p_api_version_number => 1.0
3173: ,p_init_msg_list => FND_API.G_FALSE
3174: ,p_commit => FND_API.G_FALSE
3175: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3176: ,p_action => g_asgn_action_status_update
3177: ,p_lead_assignment_id => l_assignment_id_tbl(i) -- l_lead_assignment_id
3178: ,p_status_date => sysdate
3179: ,p_status => g_la_status_active_withdrawn
3183: ,x_msg_data => x_msg_data
3184: ,x_return_status => x_return_status);
3185:
3186:
3187: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3188: raise FND_API.G_EXC_ERROR;
3189: end if;
3190: end loop;
3191:
3184: ,x_return_status => x_return_status);
3185:
3186:
3187: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3188: raise FND_API.G_EXC_ERROR;
3189: end if;
3190: end loop;
3191:
3192: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3196: END IF;
3197:
3198: pv_assignment_pvt.removeRejectedFromAccess (
3199: p_api_version_number => 1.0,
3200: p_init_msg_list => FND_API.G_FALSE,
3201: p_commit => FND_API.G_FALSE,
3202: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3203: p_itemtype => l_itemType,
3204: p_itemkey => l_itemKey,
3197:
3198: pv_assignment_pvt.removeRejectedFromAccess (
3199: p_api_version_number => 1.0,
3200: p_init_msg_list => FND_API.G_FALSE,
3201: p_commit => FND_API.G_FALSE,
3202: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3203: p_itemtype => l_itemType,
3204: p_itemkey => l_itemKey,
3205: p_partner_id => l_partner_id,
3198: pv_assignment_pvt.removeRejectedFromAccess (
3199: p_api_version_number => 1.0,
3200: p_init_msg_list => FND_API.G_FALSE,
3201: p_commit => FND_API.G_FALSE,
3202: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3203: p_itemtype => l_itemType,
3204: p_itemkey => l_itemKey,
3205: p_partner_id => l_partner_id,
3206: x_return_status => x_return_status,
3206: x_return_status => x_return_status,
3207: x_msg_count => x_msg_count,
3208: x_msg_data => x_msg_data);
3209:
3210: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3211: raise FND_API.G_EXC_ERROR;
3212: end if;
3213:
3214: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3207: x_msg_count => x_msg_count,
3208: x_msg_data => x_msg_data);
3209:
3210: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3211: raise FND_API.G_EXC_ERROR;
3212: end if;
3213:
3214: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3215: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3219:
3220: PV_ASSIGN_UTIL_PVT.removePreferedPartner
3221: (
3222: p_api_version_number => 1.0,
3223: p_init_msg_list => FND_API.G_FALSE,
3224: p_commit => FND_API.G_FALSE,
3225: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3226: p_lead_id => p_lead_id,
3227: p_item_type => l_itemType,
3220: PV_ASSIGN_UTIL_PVT.removePreferedPartner
3221: (
3222: p_api_version_number => 1.0,
3223: p_init_msg_list => FND_API.G_FALSE,
3224: p_commit => FND_API.G_FALSE,
3225: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3226: p_lead_id => p_lead_id,
3227: p_item_type => l_itemType,
3228: p_item_key => l_itemKey,
3221: (
3222: p_api_version_number => 1.0,
3223: p_init_msg_list => FND_API.G_FALSE,
3224: p_commit => FND_API.G_FALSE,
3225: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3226: p_lead_id => p_lead_id,
3227: p_item_type => l_itemType,
3228: p_item_key => l_itemKey,
3229: p_partner_id => l_partner_id,
3230: x_return_status => x_return_status,
3231: x_msg_count => x_msg_count,
3232: x_msg_data => x_msg_data
3233: );
3234: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3235: raise FND_API.G_EXC_ERROR;
3236: end if;
3237:
3238: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3231: x_msg_count => x_msg_count,
3232: x_msg_data => x_msg_data
3233: );
3234: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3235: raise FND_API.G_EXC_ERROR;
3236: end if;
3237:
3238: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3239: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3242: END IF;
3243:
3244: pv_assignment_pvt.update_routing_stage (
3245: p_api_version_number => 1.0,
3246: p_init_msg_list => FND_API.G_FALSE,
3247: p_commit => FND_API.G_FALSE,
3248: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3249: p_itemType => l_itemtype,
3250: p_itemKey => l_itemKey,
3243:
3244: pv_assignment_pvt.update_routing_stage (
3245: p_api_version_number => 1.0,
3246: p_init_msg_list => FND_API.G_FALSE,
3247: p_commit => FND_API.G_FALSE,
3248: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3249: p_itemType => l_itemtype,
3250: p_itemKey => l_itemKey,
3251: p_routing_stage => pv_assignment_pub.g_r_status_withdrawn,
3244: pv_assignment_pvt.update_routing_stage (
3245: p_api_version_number => 1.0,
3246: p_init_msg_list => FND_API.G_FALSE,
3247: p_commit => FND_API.G_FALSE,
3248: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3249: p_itemType => l_itemtype,
3250: p_itemKey => l_itemKey,
3251: p_routing_stage => pv_assignment_pub.g_r_status_withdrawn,
3252: p_active_but_open_flag => 'N',
3253: x_return_status => x_return_status,
3254: x_msg_count => x_msg_count,
3255: x_msg_data => x_msg_data);
3256:
3257: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3258: raise FND_API.G_EXC_ERROR;
3259: end if;
3260:
3261:
3254: x_msg_count => x_msg_count,
3255: x_msg_data => x_msg_data);
3256:
3257: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3258: raise FND_API.G_EXC_ERROR;
3259: end if;
3260:
3261:
3262: /* OPEN lc_get_assign_type_meaning(l_assignment_type);
3291: l_attrib_values_rec.process_name := pv_workflow_pub.g_wf_pcs_withdraw_fyi;
3292:
3293: pv_assignment_pvt.StartWorkflow (
3294: p_api_version_number => 1.0,
3295: p_init_msg_list => FND_API.G_FALSE,
3296: p_commit => FND_API.G_FALSE,
3297: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3298: p_itemKey => l_itemKey,
3299: p_itemType => l_itemType,
3292:
3293: pv_assignment_pvt.StartWorkflow (
3294: p_api_version_number => 1.0,
3295: p_init_msg_list => FND_API.G_FALSE,
3296: p_commit => FND_API.G_FALSE,
3297: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3298: p_itemKey => l_itemKey,
3299: p_itemType => l_itemType,
3300: p_creating_username => p_user_name,
3293: pv_assignment_pvt.StartWorkflow (
3294: p_api_version_number => 1.0,
3295: p_init_msg_list => FND_API.G_FALSE,
3296: p_commit => FND_API.G_FALSE,
3297: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3298: p_itemKey => l_itemKey,
3299: p_itemType => l_itemType,
3300: p_creating_username => p_user_name,
3301: p_attrib_values_rec => l_attrib_values_rec,
3310: fnd_message.set_name('PV', 'PV_CANNOT_WITHDRAW_ASGNMENT');
3311: fnd_message.set_token('P_ROUTING_STAGE', l_routing_stage);
3312: fnd_msg_pub.ADD;
3313:
3314: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3315:
3316: end if;
3317:
3318:
3319:
3320: -- For RUN mode errors, you need to check wf_item_activity_statuses
3321:
3322: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
3323: ,p_init_msg_list => FND_API.G_FALSE
3324: ,p_commit => FND_API.G_FALSE
3325: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3326: ,p_itemtype => l_itemtype
3327: ,p_itemkey => l_itemkey
3320: -- For RUN mode errors, you need to check wf_item_activity_statuses
3321:
3322: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
3323: ,p_init_msg_list => FND_API.G_FALSE
3324: ,p_commit => FND_API.G_FALSE
3325: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3326: ,p_itemtype => l_itemtype
3327: ,p_itemkey => l_itemkey
3328: ,x_return_status => x_return_status
3321:
3322: PV_ASSIGN_UTIL_PVT.checkforErrors ( p_api_version_number => 1.0
3323: ,p_init_msg_list => FND_API.G_FALSE
3324: ,p_commit => FND_API.G_FALSE
3325: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3326: ,p_itemtype => l_itemtype
3327: ,p_itemkey => l_itemkey
3328: ,x_return_status => x_return_status
3329: ,x_msg_count => x_msg_count
3328: ,x_return_status => x_return_status
3329: ,x_msg_count => x_msg_count
3330: ,x_msg_data => x_msg_data);
3331:
3332: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3333: raise FND_API.G_EXC_ERROR;
3334: end if;
3335:
3336:
3329: ,x_msg_count => x_msg_count
3330: ,x_msg_data => x_msg_data);
3331:
3332: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3333: raise FND_API.G_EXC_ERROR;
3334: end if;
3335:
3336:
3337: IF FND_API.To_Boolean ( p_commit ) THEN
3333: raise FND_API.G_EXC_ERROR;
3334: end if;
3335:
3336:
3337: IF FND_API.To_Boolean ( p_commit ) THEN
3338: COMMIT WORK;
3339: END IF;
3340:
3341: -- Standard call to get message count and if count is 1, get message info.
3338: COMMIT WORK;
3339: END IF;
3340:
3341: -- Standard call to get message count and if count is 1, get message info.
3342: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3343: p_count => x_msg_count,
3344: p_data => x_msg_data);
3345:
3346: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
3342: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3343: p_count => x_msg_count,
3344: p_data => x_msg_data);
3345:
3346: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
3347:
3348: EXCEPTION
3349:
3350: WHEN FND_API.G_EXC_ERROR THEN
3346: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
3347:
3348: EXCEPTION
3349:
3350: WHEN FND_API.G_EXC_ERROR THEN
3351:
3352: x_return_status := FND_API.G_RET_STS_ERROR ;
3353: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3354: p_count => x_msg_count,
3348: EXCEPTION
3349:
3350: WHEN FND_API.G_EXC_ERROR THEN
3351:
3352: x_return_status := FND_API.G_RET_STS_ERROR ;
3353: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3354: p_count => x_msg_count,
3355: p_data => x_msg_data);
3356:
3349:
3350: WHEN FND_API.G_EXC_ERROR THEN
3351:
3352: x_return_status := FND_API.G_RET_STS_ERROR ;
3353: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3354: p_count => x_msg_count,
3355: p_data => x_msg_data);
3356:
3357: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3353: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3354: p_count => x_msg_count,
3355: p_data => x_msg_data);
3356:
3357: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3358:
3359: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3360: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3361: p_count => x_msg_count,
3355: p_data => x_msg_data);
3356:
3357: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3358:
3359: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3360: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3361: p_count => x_msg_count,
3362: p_data => x_msg_data);
3363:
3356:
3357: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3358:
3359: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3360: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3361: p_count => x_msg_count,
3362: p_data => x_msg_data);
3363:
3364: WHEN OTHERS THEN
3369: ELSE
3370: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
3371: END IF;
3372:
3373: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3374: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3375: p_count => x_msg_count,
3376: p_data => x_msg_data);
3377:
3370: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
3371: END IF;
3372:
3373: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3374: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3375: p_count => x_msg_count,
3376: p_data => x_msg_data);
3377:
3378: end WITHDRAW_ASSIGNMENT;
3379:
3380:
3381: procedure ABANDON_ASSIGNMENT (
3382: p_api_version_number IN NUMBER
3383: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
3384: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
3385: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
3386: ,p_entity in VARCHAR2
3387: ,p_lead_id IN NUMBER
3380:
3381: procedure ABANDON_ASSIGNMENT (
3382: p_api_version_number IN NUMBER
3383: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
3384: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
3385: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
3386: ,p_entity in VARCHAR2
3387: ,p_lead_id IN NUMBER
3388: ,p_user_name IN VARCHAR2
3381: procedure ABANDON_ASSIGNMENT (
3382: p_api_version_number IN NUMBER
3383: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
3384: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
3385: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
3386: ,p_entity in VARCHAR2
3387: ,p_lead_id IN NUMBER
3388: ,p_user_name IN VARCHAR2
3389: ,p_reason_code IN varchar2
3549: begin
3550:
3551: -- Standard call to check for call compatibility.
3552:
3553: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
3554: p_api_version_number,
3555: l_api_name,
3556: G_PKG_NAME) THEN
3557: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3553: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
3554: p_api_version_number,
3555: l_api_name,
3556: G_PKG_NAME) THEN
3557: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3558:
3559: END IF;
3560:
3561: -- Initialize message list if p_init_msg_list is set to TRUE.
3558:
3559: END IF;
3560:
3561: -- Initialize message list if p_init_msg_list is set to TRUE.
3562: IF FND_API.to_Boolean( p_init_msg_list ) THEN
3563: fnd_msg_pub.initialize;
3564: END IF;
3565:
3566: if fnd_profile.value('ASF_PROFILE_DEBUG_MSG_ON') = 'Y' then
3565:
3566: if fnd_profile.value('ASF_PROFILE_DEBUG_MSG_ON') = 'Y' then
3567: FND_MSG_PUB.g_msg_level_threshold := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
3568: else
3569: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
3570: end if;
3571:
3572: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3573: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3574: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || '. Lead id =' || p_lead_id);
3575: fnd_msg_pub.Add;
3576: END IF;
3577:
3578: x_return_status := FND_API.G_RET_STS_SUCCESS ;
3579:
3580: pv_assign_util_pvt.GetWorkflowID(p_api_version_number => 1.0,
3581: p_init_msg_list => FND_API.G_FALSE,
3582: p_commit => FND_API.G_FALSE,
3577:
3578: x_return_status := FND_API.G_RET_STS_SUCCESS ;
3579:
3580: pv_assign_util_pvt.GetWorkflowID(p_api_version_number => 1.0,
3581: p_init_msg_list => FND_API.G_FALSE,
3582: p_commit => FND_API.G_FALSE,
3583: p_validation_level => p_validation_level,
3584: p_lead_id => p_lead_id,
3585: p_entity => p_entity,
3578: x_return_status := FND_API.G_RET_STS_SUCCESS ;
3579:
3580: pv_assign_util_pvt.GetWorkflowID(p_api_version_number => 1.0,
3581: p_init_msg_list => FND_API.G_FALSE,
3582: p_commit => FND_API.G_FALSE,
3583: p_validation_level => p_validation_level,
3584: p_lead_id => p_lead_id,
3585: p_entity => p_entity,
3586: x_itemType => l_itemType,
3590: x_return_status => x_return_status,
3591: x_msg_count => x_msg_count,
3592: x_msg_data => x_msg_data);
3593:
3594: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3595: raise FND_API.G_EXC_ERROR;
3596: end if;
3597:
3598: if l_routing_stage <> g_r_status_active or l_routing_stage is NULL then
3591: x_msg_count => x_msg_count,
3592: x_msg_data => x_msg_data);
3593:
3594: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3595: raise FND_API.G_EXC_ERROR;
3596: end if;
3597:
3598: if l_routing_stage <> g_r_status_active or l_routing_stage is NULL then
3599:
3598: if l_routing_stage <> g_r_status_active or l_routing_stage is NULL then
3599:
3600: fnd_message.Set_Name('PV', 'PV_CANNOT_ABANDON');
3601: fnd_msg_pub.ADD;
3602: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3603:
3604: end if;
3605:
3606: open lc_get_partner_id (pc_itemtype => l_itemtype,
3614:
3615: fnd_message.Set_Name('PV', 'PV_NO_ABANDON_RIGHTS');
3616: fnd_message.Set_Token('P_USERNAME', p_user_name);
3617: fnd_msg_pub.ADD;
3618: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3619:
3620: end if;
3621:
3622: l_party_notify_rec.WF_ITEM_TYPE := l_itemtype;
3631: l_party_notify_rec.DECISION_MAKER_FLAG := 'Y';
3632:
3633: pv_assign_util_pvt.create_party_notification(
3634: p_api_version_number => 1.0
3635: ,p_init_msg_list => FND_API.G_FALSE
3636: ,p_commit => FND_API.G_FALSE
3637: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3638: ,P_party_notify_Rec => l_party_notify_rec
3639: ,x_party_notification_id => l_party_notification_id
3632:
3633: pv_assign_util_pvt.create_party_notification(
3634: p_api_version_number => 1.0
3635: ,p_init_msg_list => FND_API.G_FALSE
3636: ,p_commit => FND_API.G_FALSE
3637: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3638: ,P_party_notify_Rec => l_party_notify_rec
3639: ,x_party_notification_id => l_party_notification_id
3640: ,x_return_status => x_return_status
3633: pv_assign_util_pvt.create_party_notification(
3634: p_api_version_number => 1.0
3635: ,p_init_msg_list => FND_API.G_FALSE
3636: ,p_commit => FND_API.G_FALSE
3637: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3638: ,P_party_notify_Rec => l_party_notify_rec
3639: ,x_party_notification_id => l_party_notification_id
3640: ,x_return_status => x_return_status
3641: ,x_msg_count => x_msg_count
3640: ,x_return_status => x_return_status
3641: ,x_msg_count => x_msg_count
3642: ,x_msg_data => x_msg_data);
3643:
3644: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3645: raise FND_API.G_EXC_ERROR;
3646: end if;
3647:
3648: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3641: ,x_msg_count => x_msg_count
3642: ,x_msg_data => x_msg_data);
3643:
3644: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3645: raise FND_API.G_EXC_ERROR;
3646: end if;
3647:
3648: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3649: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3652: END IF;
3653:
3654: pv_assignment_pvt.UpdateAssignment (
3655: p_api_version_number => 1.0
3656: ,p_init_msg_list => FND_API.G_FALSE
3657: ,p_commit => FND_API.G_FALSE
3658: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3659: ,p_action => g_asgn_action_status_update
3660: ,p_lead_assignment_id => l_lead_assignment_id
3653:
3654: pv_assignment_pvt.UpdateAssignment (
3655: p_api_version_number => 1.0
3656: ,p_init_msg_list => FND_API.G_FALSE
3657: ,p_commit => FND_API.G_FALSE
3658: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3659: ,p_action => g_asgn_action_status_update
3660: ,p_lead_assignment_id => l_lead_assignment_id
3661: ,p_status_date => sysdate
3654: pv_assignment_pvt.UpdateAssignment (
3655: p_api_version_number => 1.0
3656: ,p_init_msg_list => FND_API.G_FALSE
3657: ,p_commit => FND_API.G_FALSE
3658: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
3659: ,p_action => g_asgn_action_status_update
3660: ,p_lead_assignment_id => l_lead_assignment_id
3661: ,p_status_date => sysdate
3662: ,p_status => g_la_status_pt_abandoned
3665: ,x_msg_count => x_msg_count
3666: ,x_msg_data => x_msg_data
3667: ,x_return_status => x_return_status);
3668:
3669: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3670: raise FND_API.G_EXC_ERROR;
3671: end if;
3672:
3673: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3666: ,x_msg_data => x_msg_data
3667: ,x_return_status => x_return_status);
3668:
3669: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3670: raise FND_API.G_EXC_ERROR;
3671: end if;
3672:
3673: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3674: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3678:
3679: PV_ASSIGN_UTIL_PVT.removePreferedPartner
3680: (
3681: p_api_version_number => 1.0,
3682: p_init_msg_list => FND_API.G_FALSE,
3683: p_commit => FND_API.G_FALSE,
3684: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3685: p_lead_id => p_lead_id,
3686: p_item_type => NULL,
3679: PV_ASSIGN_UTIL_PVT.removePreferedPartner
3680: (
3681: p_api_version_number => 1.0,
3682: p_init_msg_list => FND_API.G_FALSE,
3683: p_commit => FND_API.G_FALSE,
3684: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3685: p_lead_id => p_lead_id,
3686: p_item_type => NULL,
3687: p_item_key => NULL,
3680: (
3681: p_api_version_number => 1.0,
3682: p_init_msg_list => FND_API.G_FALSE,
3683: p_commit => FND_API.G_FALSE,
3684: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3685: p_lead_id => p_lead_id,
3686: p_item_type => NULL,
3687: p_item_key => NULL,
3688: p_partner_id => l_partner_id,
3689: x_return_status => x_return_status,
3690: x_msg_count => x_msg_count,
3691: x_msg_data => x_msg_data
3692: );
3693: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3694: raise FND_API.G_EXC_ERROR;
3695: end if;
3696:
3697: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3690: x_msg_count => x_msg_count,
3691: x_msg_data => x_msg_data
3692: );
3693: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3694: raise FND_API.G_EXC_ERROR;
3695: end if;
3696:
3697: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
3698: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
3708:
3709:
3710: pv_assignment_pvt.removeRejectedFromAccess (
3711: p_api_version_number => 1.0,
3712: p_init_msg_list => FND_API.G_FALSE,
3713: p_commit => FND_API.G_FALSE,
3714: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3715: p_itemtype => l_itemType,
3716: p_itemkey => l_itemKey,
3709:
3710: pv_assignment_pvt.removeRejectedFromAccess (
3711: p_api_version_number => 1.0,
3712: p_init_msg_list => FND_API.G_FALSE,
3713: p_commit => FND_API.G_FALSE,
3714: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3715: p_itemtype => l_itemType,
3716: p_itemkey => l_itemKey,
3717: p_partner_id => l_partner_id,
3710: pv_assignment_pvt.removeRejectedFromAccess (
3711: p_api_version_number => 1.0,
3712: p_init_msg_list => FND_API.G_FALSE,
3713: p_commit => FND_API.G_FALSE,
3714: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3715: p_itemtype => l_itemType,
3716: p_itemkey => l_itemKey,
3717: p_partner_id => l_partner_id,
3718: x_return_status => x_return_status,
3718: x_return_status => x_return_status,
3719: x_msg_count => x_msg_count,
3720: x_msg_data => x_msg_data);
3721:
3722: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3723: raise FND_API.G_EXC_ERROR;
3724: end if;
3725:
3726: open lc_all_abandon_chk (pc_itemtype => l_itemtype,
3719: x_msg_count => x_msg_count,
3720: x_msg_data => x_msg_data);
3721:
3722: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3723: raise FND_API.G_EXC_ERROR;
3724: end if;
3725:
3726: open lc_all_abandon_chk (pc_itemtype => l_itemtype,
3727: pc_itemkey => l_itemkey);
3743: END IF;
3744:
3745: pv_assignment_pvt.update_routing_stage (
3746: p_api_version_number => 1.0,
3747: p_init_msg_list => FND_API.G_FALSE,
3748: p_commit => FND_API.G_FALSE,
3749: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3750: p_itemType => l_itemtype,
3751: p_itemKey => l_itemKey,
3744:
3745: pv_assignment_pvt.update_routing_stage (
3746: p_api_version_number => 1.0,
3747: p_init_msg_list => FND_API.G_FALSE,
3748: p_commit => FND_API.G_FALSE,
3749: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3750: p_itemType => l_itemtype,
3751: p_itemKey => l_itemKey,
3752: p_routing_stage => pv_assignment_pub.g_r_status_abandoned,
3745: pv_assignment_pvt.update_routing_stage (
3746: p_api_version_number => 1.0,
3747: p_init_msg_list => FND_API.G_FALSE,
3748: p_commit => FND_API.G_FALSE,
3749: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3750: p_itemType => l_itemtype,
3751: p_itemKey => l_itemKey,
3752: p_routing_stage => pv_assignment_pub.g_r_status_abandoned,
3753: p_active_but_open_flag => 'N',
3754: x_return_status => x_return_status,
3755: x_msg_count => x_msg_count,
3756: x_msg_data => x_msg_data);
3757:
3758: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3759: raise FND_API.G_EXC_ERROR;
3760: end if;
3761:
3762:
3755: x_msg_count => x_msg_count,
3756: x_msg_data => x_msg_data);
3757:
3758: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3759: raise FND_API.G_EXC_ERROR;
3760: end if;
3761:
3762:
3763: OPEN lc_get_pt_org_name(l_partner_id);
3821:
3822:
3823: pv_assignment_pvt.AbandonWorkflow (
3824: p_api_version_number => 1.0,
3825: p_init_msg_list => FND_API.G_FALSE,
3826: p_commit => FND_API.G_FALSE,
3827: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3828: p_creating_username => p_user_name,
3829: p_attrib_values_rec => l_attrib_values_rec,
3822:
3823: pv_assignment_pvt.AbandonWorkflow (
3824: p_api_version_number => 1.0,
3825: p_init_msg_list => FND_API.G_FALSE,
3826: p_commit => FND_API.G_FALSE,
3827: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3828: p_creating_username => p_user_name,
3829: p_attrib_values_rec => l_attrib_values_rec,
3830: p_action_reason => l_action_reason,
3823: pv_assignment_pvt.AbandonWorkflow (
3824: p_api_version_number => 1.0,
3825: p_init_msg_list => FND_API.G_FALSE,
3826: p_commit => FND_API.G_FALSE,
3827: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3828: p_creating_username => p_user_name,
3829: p_attrib_values_rec => l_attrib_values_rec,
3830: p_action_reason => l_action_reason,
3831: p_partner_org_name => l_partner_org,
3835:
3836:
3837: end if;
3838:
3839: IF FND_API.To_Boolean ( p_commit ) THEN
3840: COMMIT WORK;
3841: END IF;
3842:
3843: -- Standard call to get message count and if count is 1, get message info.
3840: COMMIT WORK;
3841: END IF;
3842:
3843: -- Standard call to get message count and if count is 1, get message info.
3844: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3845: p_count => x_msg_count,
3846: p_data => x_msg_data);
3847:
3848: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
3844: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3845: p_count => x_msg_count,
3846: p_data => x_msg_data);
3847:
3848: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
3849:
3850: EXCEPTION
3851:
3852: WHEN FND_API.G_EXC_ERROR THEN
3848: FND_MSG_PUB.g_msg_level_threshold := FND_API.G_MISS_NUM;
3849:
3850: EXCEPTION
3851:
3852: WHEN FND_API.G_EXC_ERROR THEN
3853:
3854: x_return_status := FND_API.G_RET_STS_ERROR ;
3855: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3856: p_count => x_msg_count,
3850: EXCEPTION
3851:
3852: WHEN FND_API.G_EXC_ERROR THEN
3853:
3854: x_return_status := FND_API.G_RET_STS_ERROR ;
3855: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3856: p_count => x_msg_count,
3857: p_data => x_msg_data);
3858:
3851:
3852: WHEN FND_API.G_EXC_ERROR THEN
3853:
3854: x_return_status := FND_API.G_RET_STS_ERROR ;
3855: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3856: p_count => x_msg_count,
3857: p_data => x_msg_data);
3858:
3859: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3855: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3856: p_count => x_msg_count,
3857: p_data => x_msg_data);
3858:
3859: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3860:
3861: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3862: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3863: p_count => x_msg_count,
3857: p_data => x_msg_data);
3858:
3859: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3860:
3861: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3862: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3863: p_count => x_msg_count,
3864: p_data => x_msg_data);
3865:
3858:
3859: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3860:
3861: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3862: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3863: p_count => x_msg_count,
3864: p_data => x_msg_data);
3865:
3866: WHEN OTHERS THEN
3864: p_data => x_msg_data);
3865:
3866: WHEN OTHERS THEN
3867:
3868: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3869: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
3870: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3871: p_count => x_msg_count,
3872: p_data => x_msg_data);
3866: WHEN OTHERS THEN
3867:
3868: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3869: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
3870: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_FALSE,
3871: p_count => x_msg_count,
3872: p_data => x_msg_data);
3873:
3874: end ABANDON_ASSIGNMENT;