28:
29: -- private to this package
30: procedure CreateRole (
31: p_api_version_number IN NUMBER
32: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
33: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
34: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
35: ,p_itemType IN VARCHAR2
36: ,p_itemKey IN VARCHAR2
29: -- private to this package
30: procedure CreateRole (
31: p_api_version_number IN NUMBER
32: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
33: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
34: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
35: ,p_itemType IN VARCHAR2
36: ,p_itemKey IN VARCHAR2
37: ,p_partner_id IN NUMBER
30: procedure CreateRole (
31: p_api_version_number IN NUMBER
32: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
33: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
34: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
35: ,p_itemType IN VARCHAR2
36: ,p_itemKey IN VARCHAR2
37: ,p_partner_id IN NUMBER
38: ,p_notify_type IN VARCHAR2
70:
71: begin
72: -- Standard call to check for call compatibility.
73:
74: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
75: p_api_version_number,
76: l_api_name,
77: G_PKG_NAME) THEN
78: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
74: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
75: p_api_version_number,
76: l_api_name,
77: G_PKG_NAME) THEN
78: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
79:
80: END IF;
81:
82: -- Initialize message list if p_init_msg_list is set to TRUE.
79:
80: END IF;
81:
82: -- Initialize message list if p_init_msg_list is set to TRUE.
83: IF FND_API.to_Boolean( p_init_msg_list )
84: THEN
85: fnd_msg_pub.initialize;
86: END IF;
87:
92: '. Itemtype: ' || p_itemtype || '. p_assignemnt_status: ' || p_assignment_status);
93: fnd_msg_pub.Add;
94: END IF;
95:
96: x_return_status := FND_API.G_RET_STS_SUCCESS ;
97:
98: l_adhoc_role := 'PV2' || p_notify_type || p_itemkey || '+' || nvl(p_partner_id, '0');
99:
100: open lc_get_party_for_status (pc_itemType => p_itemtype,
157:
158: fnd_message.SET_NAME('PV', 'PV_EMPTY_ROLE');
159: fnd_msg_pub.ADD;
160:
161: raise FND_API.G_EXC_ERROR;
162:
163: end if;
164:
165: IF FND_API.To_Boolean ( p_commit ) THEN
161: raise FND_API.G_EXC_ERROR;
162:
163: end if;
164:
165: IF FND_API.To_Boolean ( p_commit ) THEN
166: COMMIT WORK;
167: END IF;
168:
169: -- Standard call to get message count and if count is 1, get message info.
166: COMMIT WORK;
167: END IF;
168:
169: -- Standard call to get message count and if count is 1, get message info.
170: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
171: p_count => x_msg_count,
172: p_data => x_msg_data);
173: EXCEPTION
174:
171: p_count => x_msg_count,
172: p_data => x_msg_data);
173: EXCEPTION
174:
175: WHEN FND_API.G_EXC_ERROR THEN
176:
177: x_return_status := FND_API.G_RET_STS_ERROR ;
178: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
179: p_count => x_msg_count,
173: EXCEPTION
174:
175: WHEN FND_API.G_EXC_ERROR THEN
176:
177: x_return_status := FND_API.G_RET_STS_ERROR ;
178: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
179: p_count => x_msg_count,
180: p_data => x_msg_data);
181:
174:
175: WHEN FND_API.G_EXC_ERROR THEN
176:
177: x_return_status := FND_API.G_RET_STS_ERROR ;
178: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
179: p_count => x_msg_count,
180: p_data => x_msg_data);
181:
182: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
178: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
179: p_count => x_msg_count,
180: p_data => x_msg_data);
181:
182: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
183:
184: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
185: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
186: p_count => x_msg_count,
180: p_data => x_msg_data);
181:
182: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
183:
184: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
185: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
186: p_count => x_msg_count,
187: p_data => x_msg_data);
188:
181:
182: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
183:
184: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
185: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
186: p_count => x_msg_count,
187: p_data => x_msg_data);
188:
189: WHEN OTHERS THEN
187: p_data => x_msg_data);
188:
189: WHEN OTHERS THEN
190:
191: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
192: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
193: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
194: p_count => x_msg_count,
195: p_data => x_msg_data);
189: WHEN OTHERS THEN
190:
191: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
192: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
193: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
194: p_count => x_msg_count,
195: p_data => x_msg_data);
196: end CreateRole;
197:
205: /********************************************************/
206:
207: procedure Send_Email_By_Workflow (
208: p_api_version_number IN NUMBER,
209: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
210: p_commit IN VARCHAR2 := FND_API.G_FALSE,
211: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
212: p_user_name_tbl IN JTF_VARCHAR2_TABLE_100,
213: p_user_type_tbl IN JTF_VARCHAR2_TABLE_100,
206:
207: procedure Send_Email_By_Workflow (
208: p_api_version_number IN NUMBER,
209: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
210: p_commit IN VARCHAR2 := FND_API.G_FALSE,
211: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
212: p_user_name_tbl IN JTF_VARCHAR2_TABLE_100,
213: p_user_type_tbl IN JTF_VARCHAR2_TABLE_100,
214: p_username IN VARCHAR2,
207: procedure Send_Email_By_Workflow (
208: p_api_version_number IN NUMBER,
209: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
210: p_commit IN VARCHAR2 := FND_API.G_FALSE,
211: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
212: p_user_name_tbl IN JTF_VARCHAR2_TABLE_100,
213: p_user_type_tbl IN JTF_VARCHAR2_TABLE_100,
214: p_username IN VARCHAR2,
215: p_opp_amt IN VARCHAR2,
245: l_email_enabled VARCHAR2(5);
246:
247: begin
248: -- Standard call to check for call compatibility.
249: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
250: p_api_version_number,
251: l_api_name,
252: G_PKG_NAME) THEN
253: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
249: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
250: p_api_version_number,
251: l_api_name,
252: G_PKG_NAME) THEN
253: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
254: END IF;
255:
256: -- Initialize message list if p_init_msg_list is set to TRUE.
257: IF FND_API.to_Boolean( p_init_msg_list )
253: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
254: END IF;
255:
256: -- Initialize message list if p_init_msg_list is set to TRUE.
257: IF FND_API.to_Boolean( p_init_msg_list )
258: THEN
259: fnd_msg_pub.initialize;
260: END IF;
261:
265: fnd_message.Set_Token('TEXT', 'In ' || l_api_name || p_from_status || p_to_status);
266: fnd_msg_pub.Add;
267: END IF;
268:
269: x_return_status := FND_API.G_RET_STS_SUCCESS ;
270:
271: -- check the profile value and return if the value is not Y
272: l_email_enabled := nvl(fnd_profile.value('PV_EMAIL_NOTIFICATION_FLAG'), 'Y');
273:
488:
489: -- Call the following procedure to see whether workflow was able to send notification successfully.
490: PV_ASSIGN_UTIL_PVT.checkforErrors
491: (p_api_version_number => 1.0
492: ,p_init_msg_list => FND_API.G_FALSE
493: ,p_commit => FND_API.G_FALSE
494: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
495: ,p_itemtype => l_itemType
496: ,p_itemkey => l_itemKey
489: -- Call the following procedure to see whether workflow was able to send notification successfully.
490: PV_ASSIGN_UTIL_PVT.checkforErrors
491: (p_api_version_number => 1.0
492: ,p_init_msg_list => FND_API.G_FALSE
493: ,p_commit => FND_API.G_FALSE
494: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
495: ,p_itemtype => l_itemType
496: ,p_itemkey => l_itemKey
497: ,x_msg_count => x_msg_count
490: PV_ASSIGN_UTIL_PVT.checkforErrors
491: (p_api_version_number => 1.0
492: ,p_init_msg_list => FND_API.G_FALSE
493: ,p_commit => FND_API.G_FALSE
494: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
495: ,p_itemtype => l_itemType
496: ,p_itemkey => l_itemKey
497: ,x_msg_count => x_msg_count
498: ,x_msg_data => x_msg_data
498: ,x_msg_data => x_msg_data
499: ,x_return_status => x_return_status);
500:
501: -- Check the x_return_status. If its not successful throw an exception.
502: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
503: raise FND_API.G_EXC_ERROR;
504: end if;
505:
506: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
499: ,x_return_status => x_return_status);
500:
501: -- Check the x_return_status. If its not successful throw an exception.
502: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
503: raise FND_API.G_EXC_ERROR;
504: end if;
505:
506: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
507: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
509: fnd_msg_pub.Add;
510: END IF;
511: END IF;
512:
513: IF FND_API.To_Boolean ( p_commit ) THEN
514: COMMIT WORK;
515: END IF;
516:
517: -- Standard call to get message count and if count is 1, get message info.
514: COMMIT WORK;
515: END IF;
516:
517: -- Standard call to get message count and if count is 1, get message info.
518: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
519: p_count => x_msg_count,
520: p_data => x_msg_data);
521: EXCEPTION
522:
519: p_count => x_msg_count,
520: p_data => x_msg_data);
521: EXCEPTION
522:
523: WHEN FND_API.G_EXC_ERROR THEN
524: x_return_status := FND_API.G_RET_STS_ERROR ;
525: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
526: p_count => x_msg_count,
527: p_data => x_msg_data);
520: p_data => x_msg_data);
521: EXCEPTION
522:
523: WHEN FND_API.G_EXC_ERROR THEN
524: x_return_status := FND_API.G_RET_STS_ERROR ;
525: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
526: p_count => x_msg_count,
527: p_data => x_msg_data);
528: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
521: EXCEPTION
522:
523: WHEN FND_API.G_EXC_ERROR THEN
524: x_return_status := FND_API.G_RET_STS_ERROR ;
525: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
526: p_count => x_msg_count,
527: p_data => x_msg_data);
528: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
529: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
524: x_return_status := FND_API.G_RET_STS_ERROR ;
525: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
526: p_count => x_msg_count,
527: p_data => x_msg_data);
528: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
529: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
530: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
531: p_count => x_msg_count,
532: p_data => x_msg_data);
525: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
526: p_count => x_msg_count,
527: p_data => x_msg_data);
528: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
529: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
530: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
531: p_count => x_msg_count,
532: p_data => x_msg_data);
533: WHEN OTHERS THEN
526: p_count => x_msg_count,
527: p_data => x_msg_data);
528: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
529: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
530: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
531: p_count => x_msg_count,
532: p_data => x_msg_data);
533: WHEN OTHERS THEN
534: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
530: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
531: p_count => x_msg_count,
532: p_data => x_msg_data);
533: WHEN OTHERS THEN
534: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
535: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
536: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
537: p_count => x_msg_count,
538: p_data => x_msg_data);
532: p_data => x_msg_data);
533: WHEN OTHERS THEN
534: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
535: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
536: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
537: p_count => x_msg_count,
538: p_data => x_msg_data);
539: end Send_Email_By_Workflow;
540:
545: /* email notification. */
546: /**********************************************************************/
547: procedure StartWorkflow (
548: p_api_version_number IN NUMBER,
549: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
550: p_commit IN VARCHAR2 := FND_API.G_FALSE,
551: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
552: p_itemKey IN VARCHAR2,
553: p_itemType IN VARCHAR2,
546: /**********************************************************************/
547: procedure StartWorkflow (
548: p_api_version_number IN NUMBER,
549: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
550: p_commit IN VARCHAR2 := FND_API.G_FALSE,
551: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
552: p_itemKey IN VARCHAR2,
553: p_itemType IN VARCHAR2,
554: p_partner_id IN NUMBER,
547: procedure StartWorkflow (
548: p_api_version_number IN NUMBER,
549: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
550: p_commit IN VARCHAR2 := FND_API.G_FALSE,
551: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
552: p_itemKey IN VARCHAR2,
553: p_itemType IN VARCHAR2,
554: p_partner_id IN NUMBER,
555: p_partner_name IN VARCHAR2,
599: AND PVPP.SALES_PARTNER_FLAG = 'Y';
600:
601: begin
602: -- Standard call to check for call compatibility.
603: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
604: p_api_version_number,
605: l_api_name,
606: G_PKG_NAME) THEN
607: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
603: IF NOT FND_API.Compatible_API_Call (l_api_version_number,
604: p_api_version_number,
605: l_api_name,
606: G_PKG_NAME) THEN
607: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
608:
609: END IF;
610:
611: -- Initialize message list if p_init_msg_list is set to TRUE.
608:
609: END IF;
610:
611: -- Initialize message list if p_init_msg_list is set to TRUE.
612: IF FND_API.to_Boolean( p_init_msg_list )
613: THEN
614: fnd_msg_pub.initialize;
615: END IF;
616:
619: debug( 'In ' || l_api_name);
620: END IF;
621:
622: -- Initialize API return status to success
623: x_return_status := FND_API.G_RET_STS_SUCCESS;
624:
625: -- check the profile value and return if the value is not Y
626: l_email_enabled := nvl(fnd_profile.value('PV_EMAIL_NOTIFICATION_FLAG'), 'Y');
627:
639:
640: -- Create the role before sending the notification
641: CreateRole (
642: p_api_version_number => 1.0
643: ,p_init_msg_list => FND_API.G_FALSE
644: ,p_commit => FND_API.G_FALSE
645: ,p_validation_level => p_validation_level
646: ,p_itemType => p_itemtype
647: ,p_itemKey => p_itemKey
640: -- Create the role before sending the notification
641: CreateRole (
642: p_api_version_number => 1.0
643: ,p_init_msg_list => FND_API.G_FALSE
644: ,p_commit => FND_API.G_FALSE
645: ,p_validation_level => p_validation_level
646: ,p_itemType => p_itemtype
647: ,p_itemKey => p_itemKey
648: ,p_partner_id => p_partner_id
652: ,x_msg_count => x_msg_count
653: ,x_msg_data => x_msg_data
654: ,x_return_status => x_return_status);
655:
656: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
657: raise FND_API.G_EXC_ERROR;
658: end if;
659:
660: -- Debug Message
653: ,x_msg_data => x_msg_data
654: ,x_return_status => x_return_status);
655:
656: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
657: raise FND_API.G_EXC_ERROR;
658: end if;
659:
660: -- Debug Message
661: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
735: END IF;
736:
737: -- Debug Message
738:
739: IF FND_API.To_Boolean ( p_commit ) THEN
740: COMMIT WORK;
741: END IF;
742:
743: -- Standard call to get message count and if count is 1, get message info.
740: COMMIT WORK;
741: END IF;
742:
743: -- Standard call to get message count and if count is 1, get message info.
744: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
745: p_count => x_msg_count,
746: p_data => x_msg_data);
747: EXCEPTION
748:
745: p_count => x_msg_count,
746: p_data => x_msg_data);
747: EXCEPTION
748:
749: WHEN FND_API.G_EXC_ERROR THEN
750: x_return_status := FND_API.G_RET_STS_ERROR ;
751: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
752: p_count => x_msg_count,
753: p_data => x_msg_data);
746: p_data => x_msg_data);
747: EXCEPTION
748:
749: WHEN FND_API.G_EXC_ERROR THEN
750: x_return_status := FND_API.G_RET_STS_ERROR ;
751: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
752: p_count => x_msg_count,
753: p_data => x_msg_data);
754: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
747: EXCEPTION
748:
749: WHEN FND_API.G_EXC_ERROR THEN
750: x_return_status := FND_API.G_RET_STS_ERROR ;
751: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
752: p_count => x_msg_count,
753: p_data => x_msg_data);
754: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
755: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
750: x_return_status := FND_API.G_RET_STS_ERROR ;
751: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
752: p_count => x_msg_count,
753: p_data => x_msg_data);
754: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
755: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
756: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
757: p_count => x_msg_count,
758: p_data => x_msg_data);
751: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
752: p_count => x_msg_count,
753: p_data => x_msg_data);
754: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
755: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
756: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
757: p_count => x_msg_count,
758: p_data => x_msg_data);
759: WHEN OTHERS THEN
752: p_count => x_msg_count,
753: p_data => x_msg_data);
754: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
755: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
756: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
757: p_count => x_msg_count,
758: p_data => x_msg_data);
759: WHEN OTHERS THEN
760: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
756: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
757: p_count => x_msg_count,
758: p_data => x_msg_data);
759: WHEN OTHERS THEN
760: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
761: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
762: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
763: p_count => x_msg_count,
764: p_data => x_msg_data);
758: p_data => x_msg_data);
759: WHEN OTHERS THEN
760: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
761: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
762: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
763: p_count => x_msg_count,
764: p_data => x_msg_data);
765: end StartWorkflow;
766:
772: /* created by Partner or VAD. */
773: /********************************************************/
774: procedure Notify_CM_On_Create_Oppty (
775: p_api_version_number IN NUMBER,
776: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
777: p_commit IN VARCHAR2 := FND_API.G_FALSE,
778: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
779: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
780: p_salesforce_id IN NUMBER,
773: /********************************************************/
774: procedure Notify_CM_On_Create_Oppty (
775: p_api_version_number IN NUMBER,
776: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
777: p_commit IN VARCHAR2 := FND_API.G_FALSE,
778: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
779: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
780: p_salesforce_id IN NUMBER,
781: p_relationship_type IN VARCHAR2,
774: procedure Notify_CM_On_Create_Oppty (
775: p_api_version_number IN NUMBER,
776: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
777: p_commit IN VARCHAR2 := FND_API.G_FALSE,
778: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
779: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
780: p_salesforce_id IN NUMBER,
781: p_relationship_type IN VARCHAR2,
782: p_party_relation_id IN NUMBER,
907:
908: BEGIN
909:
910: -- Standard call to check for call compatibility.
911: IF NOT FND_API.Compatible_API_Call(l_api_version_number,
912: p_api_version_number,
913: l_api_name,
914: G_PKG_NAME)
915: THEN
912: p_api_version_number,
913: l_api_name,
914: G_PKG_NAME)
915: THEN
916: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
917: END IF;
918:
919: -- Initialize message list if p_init_msg_list is set to TRUE.
920: IF FND_API.to_Boolean( p_init_msg_list ) THEN
916: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
917: END IF;
918:
919: -- Initialize message list if p_init_msg_list is set to TRUE.
920: IF FND_API.to_Boolean( p_init_msg_list ) THEN
921: fnd_msg_pub.initialize;
922: END IF;
923:
924: -- Debug Message
926: Debug('In ' || l_api_name);
927: END IF;
928:
929: -- Initialize API return status to success
930: x_return_status := FND_API.G_RET_STS_SUCCESS;
931:
932: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
933: Debug('Relationship Type ' || p_relationship_type);
934: END IF;
955: END IF;
956:
957: pv_assign_util_pvt.Create_lead_workflow_row
958: ( p_api_version_number => 1.0
959: ,p_init_msg_list => FND_API.G_FALSE
960: ,p_commit => FND_API.G_FALSE
961: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
962: ,p_workflow_rec => l_lead_workflow_rec
963: ,x_ItemKey => l_itemKey
956:
957: pv_assign_util_pvt.Create_lead_workflow_row
958: ( p_api_version_number => 1.0
959: ,p_init_msg_list => FND_API.G_FALSE
960: ,p_commit => FND_API.G_FALSE
961: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
962: ,p_workflow_rec => l_lead_workflow_rec
963: ,x_ItemKey => l_itemKey
964: ,x_return_status => x_return_status
957: pv_assign_util_pvt.Create_lead_workflow_row
958: ( p_api_version_number => 1.0
959: ,p_init_msg_list => FND_API.G_FALSE
960: ,p_commit => FND_API.G_FALSE
961: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
962: ,p_workflow_rec => l_lead_workflow_rec
963: ,x_ItemKey => l_itemKey
964: ,x_return_status => x_return_status
965: ,x_msg_count => x_msg_count
965: ,x_msg_count => x_msg_count
966: ,x_msg_data => x_msg_data
967: );
968:
969: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
970: RAISE FND_API.G_EXC_ERROR;
971: END IF;
972:
973: -- Get the Channel Manager information
966: ,x_msg_data => x_msg_data
967: );
968:
969: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
970: RAISE FND_API.G_EXC_ERROR;
971: END IF;
972:
973: -- Get the Channel Manager information
974: pv_assign_util_pvt.get_partner_info
972:
973: -- Get the Channel Manager information
974: pv_assign_util_pvt.get_partner_info
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_mode => pv_assignment_pub.g_external_org
980: ,p_partner_id => p_party_relation_id
973: -- Get the Channel Manager information
974: pv_assign_util_pvt.get_partner_info
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_mode => pv_assignment_pub.g_external_org
980: ,p_partner_id => p_party_relation_id
981: ,p_entity => l_entity
974: pv_assign_util_pvt.get_partner_info
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_mode => pv_assignment_pub.g_external_org
980: ,p_partner_id => p_party_relation_id
981: ,p_entity => l_entity
982: ,p_entity_id => l_lead_id
987: ,x_msg_count => x_msg_count
988: ,x_msg_data => x_msg_data
989: );
990:
991: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
992: RAISE FND_API.G_EXC_ERROR;
993: END IF;
994:
995: -- If Channel manager found create assignment and notification record
988: ,x_msg_data => x_msg_data
989: );
990:
991: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
992: RAISE FND_API.G_EXC_ERROR;
993: END IF;
994:
995: -- If Channel manager found create assignment and notification record
996: If l_rs_details_tbl.count <= 0 THEN
995: -- If Channel manager found create assignment and notification record
996: If l_rs_details_tbl.count <= 0 THEN
997: FND_MESSAGE.set_name('PV', 'PV_EMPTY_ROLE');
998: FND_MSG_PUB.add;
999: RAISE FND_API.g_exc_unexpected_error;
1000: ELSE
1001: -- Insert into table PV_LEAD_ASSIGNMENTS with STATUS to PT_CREATED.
1002: -- Populate data with the following values.
1003: l_assignment_rec.lead_id := l_lead_id;
1013: l_assignment_rec.wf_item_key := l_itemKey;
1014:
1015: pv_assign_util_pvt.Create_lead_assignment_row
1016: ( p_api_version_number => 1.0
1017: ,p_init_msg_list => FND_API.G_FALSE
1018: ,p_commit => FND_API.G_FALSE
1019: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1020: ,p_assignment_rec => l_assignment_rec
1021: ,x_lead_assignment_id => l_lead_assignment_id
1014:
1015: pv_assign_util_pvt.Create_lead_assignment_row
1016: ( p_api_version_number => 1.0
1017: ,p_init_msg_list => FND_API.G_FALSE
1018: ,p_commit => FND_API.G_FALSE
1019: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1020: ,p_assignment_rec => l_assignment_rec
1021: ,x_lead_assignment_id => l_lead_assignment_id
1022: ,x_return_status => x_return_status
1015: pv_assign_util_pvt.Create_lead_assignment_row
1016: ( p_api_version_number => 1.0
1017: ,p_init_msg_list => FND_API.G_FALSE
1018: ,p_commit => FND_API.G_FALSE
1019: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1020: ,p_assignment_rec => l_assignment_rec
1021: ,x_lead_assignment_id => l_lead_assignment_id
1022: ,x_return_status => x_return_status
1023: ,x_msg_count => x_msg_count
1023: ,x_msg_count => x_msg_count
1024: ,x_msg_data => x_msg_data
1025: );
1026:
1027: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1028: RAISE FND_API.G_EXC_ERROR;
1029: END IF;
1030:
1031: -- Insert into table PV_PARTY_NOTIFICATIONS. Populate data with the
1024: ,x_msg_data => x_msg_data
1025: );
1026:
1027: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1028: RAISE FND_API.G_EXC_ERROR;
1029: END IF;
1030:
1031: -- Insert into table PV_PARTY_NOTIFICATIONS. Populate data with the
1032: -- following values. Extend the table for the number of channel managers
1067:
1068: -- Insert in bulk for all the channel manager by calling the procedure
1069: pv_assignment_pvt.bulk_cr_party_notification
1070: ( p_api_version_number => 1.0
1071: ,p_init_msg_list => FND_API.G_FALSE
1072: ,p_commit => FND_API.G_FALSE
1073: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1074: ,p_party_notify_Rec_tbl => l_party_notify_rec_tbl
1075: ,x_return_status => x_return_status
1068: -- Insert in bulk for all the channel manager by calling the procedure
1069: pv_assignment_pvt.bulk_cr_party_notification
1070: ( p_api_version_number => 1.0
1071: ,p_init_msg_list => FND_API.G_FALSE
1072: ,p_commit => FND_API.G_FALSE
1073: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1074: ,p_party_notify_Rec_tbl => l_party_notify_rec_tbl
1075: ,x_return_status => x_return_status
1076: ,x_msg_count => x_msg_count
1069: pv_assignment_pvt.bulk_cr_party_notification
1070: ( p_api_version_number => 1.0
1071: ,p_init_msg_list => FND_API.G_FALSE
1072: ,p_commit => FND_API.G_FALSE
1073: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1074: ,p_party_notify_Rec_tbl => l_party_notify_rec_tbl
1075: ,x_return_status => x_return_status
1076: ,x_msg_count => x_msg_count
1077: ,x_msg_data => x_msg_data);
1075: ,x_return_status => x_return_status
1076: ,x_msg_count => x_msg_count
1077: ,x_msg_data => x_msg_data);
1078:
1079: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1080: RAISE FND_API.G_EXC_ERROR;
1081: END IF;
1082:
1083: -- For each Channel Manager/partner contact in l_rs_details_tbl call the procedure to
1076: ,x_msg_count => x_msg_count
1077: ,x_msg_data => x_msg_data);
1078:
1079: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1080: RAISE FND_API.G_EXC_ERROR;
1081: END IF;
1082:
1083: -- For each Channel Manager/partner contact in l_rs_details_tbl call the procedure to
1084: -- update the Sales team. This will insert rows in as_access_all.write
1156:
1157: l_sales_team_rec.sales_group_id := l_sales_group_id;
1158: as_access_pub.Create_SalesTeam
1159: (p_api_version_number => 2 -- API Version has been changed
1160: ,p_init_msg_list => FND_API.G_FALSE
1161: ,p_commit => FND_API.G_FALSE
1162: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1163: ,p_access_profile_rec => l_access_profile_rec
1164: ,p_check_access_flag => 'N'
1157: l_sales_team_rec.sales_group_id := l_sales_group_id;
1158: as_access_pub.Create_SalesTeam
1159: (p_api_version_number => 2 -- API Version has been changed
1160: ,p_init_msg_list => FND_API.G_FALSE
1161: ,p_commit => FND_API.G_FALSE
1162: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1163: ,p_access_profile_rec => l_access_profile_rec
1164: ,p_check_access_flag => 'N'
1165: ,p_admin_flag => 'N'
1158: as_access_pub.Create_SalesTeam
1159: (p_api_version_number => 2 -- API Version has been changed
1160: ,p_init_msg_list => FND_API.G_FALSE
1161: ,p_commit => FND_API.G_FALSE
1162: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1163: ,p_access_profile_rec => l_access_profile_rec
1164: ,p_check_access_flag => 'N'
1165: ,p_admin_flag => 'N'
1166: ,p_admin_group_id => null
1170: ,x_msg_count => x_msg_count
1171: ,x_msg_data => x_msg_data
1172: ,x_access_id => l_access_id);
1173:
1174: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1175: RAISE FND_API.G_EXC_ERROR;
1176: END IF;
1177:
1178: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1171: ,x_msg_data => x_msg_data
1172: ,x_access_id => l_access_id);
1173:
1174: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1175: RAISE FND_API.G_EXC_ERROR;
1176: END IF;
1177:
1178: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1179: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1213: l_sales_team_rec.team_leader_flag := 'N'; --Added per Suresh
1214:
1215: as_access_pub.Create_SalesTeam
1216: (p_api_version_number => 2 -- API Version has been changed
1217: ,p_init_msg_list => FND_API.G_FALSE
1218: ,p_commit => FND_API.G_FALSE
1219: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1220: ,p_access_profile_rec => l_access_profile_rec
1221: ,p_check_access_flag => 'N'
1214:
1215: as_access_pub.Create_SalesTeam
1216: (p_api_version_number => 2 -- API Version has been changed
1217: ,p_init_msg_list => FND_API.G_FALSE
1218: ,p_commit => FND_API.G_FALSE
1219: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1220: ,p_access_profile_rec => l_access_profile_rec
1221: ,p_check_access_flag => 'N'
1222: ,p_admin_flag => 'N'
1215: as_access_pub.Create_SalesTeam
1216: (p_api_version_number => 2 -- API Version has been changed
1217: ,p_init_msg_list => FND_API.G_FALSE
1218: ,p_commit => FND_API.G_FALSE
1219: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1220: ,p_access_profile_rec => l_access_profile_rec
1221: ,p_check_access_flag => 'N'
1222: ,p_admin_flag => 'N'
1223: ,p_admin_group_id => null
1228: ,x_msg_data => x_msg_data
1229: ,x_access_id => l_access_id);
1230:
1231: -- Check the x_return_status. If its not successful throw an exception.
1232: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1233: RAISE FND_API.G_EXC_ERROR;
1234: END IF;
1235:
1236: -- Add the VAD id when the opportunity is created by Indirectly Managed Partner
1229: ,x_access_id => l_access_id);
1230:
1231: -- Check the x_return_status. If its not successful throw an exception.
1232: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1233: RAISE FND_API.G_EXC_ERROR;
1234: END IF;
1235:
1236: -- Add the VAD id when the opportunity is created by Indirectly Managed Partner
1237: -- Adding VAD organization will allow to add salesteam from that organization
1256: l_sales_team_rec.team_leader_flag := 'Y'; --Added per Suresh
1257:
1258: as_access_pub.Create_SalesTeam
1259: (p_api_version_number => 2 -- API Version has been changed
1260: ,p_init_msg_list => FND_API.G_FALSE
1261: ,p_commit => FND_API.G_FALSE
1262: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1263: ,p_access_profile_rec => l_access_profile_rec
1264: ,p_check_access_flag => 'N'
1257:
1258: as_access_pub.Create_SalesTeam
1259: (p_api_version_number => 2 -- API Version has been changed
1260: ,p_init_msg_list => FND_API.G_FALSE
1261: ,p_commit => FND_API.G_FALSE
1262: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1263: ,p_access_profile_rec => l_access_profile_rec
1264: ,p_check_access_flag => 'N'
1265: ,p_admin_flag => 'N'
1258: as_access_pub.Create_SalesTeam
1259: (p_api_version_number => 2 -- API Version has been changed
1260: ,p_init_msg_list => FND_API.G_FALSE
1261: ,p_commit => FND_API.G_FALSE
1262: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1263: ,p_access_profile_rec => l_access_profile_rec
1264: ,p_check_access_flag => 'N'
1265: ,p_admin_flag => 'N'
1266: ,p_admin_group_id => null
1271: ,x_msg_data => x_msg_data
1272: ,x_access_id => l_access_id);
1273:
1274: -- Check the x_return_status. If its not successful throw an exception.
1275: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1276: RAISE FND_API.G_EXC_ERROR;
1277: END IF;
1278:
1279: END IF;
1272: ,x_access_id => l_access_id);
1273:
1274: -- Check the x_return_status. If its not successful throw an exception.
1275: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1276: RAISE FND_API.G_EXC_ERROR;
1277: END IF;
1278:
1279: END IF;
1280:
1321:
1322: -- When all the table are updated start the workflow .
1323: StartWorkflow
1324: ( p_api_version_number => 1.0,
1325: p_init_msg_list => FND_API.G_FALSE,
1326: p_commit => FND_API.G_FALSE,
1327: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1328: p_itemKey => l_itemKey,
1329: p_itemType => l_itemType,
1322: -- When all the table are updated start the workflow .
1323: StartWorkflow
1324: ( p_api_version_number => 1.0,
1325: p_init_msg_list => FND_API.G_FALSE,
1326: p_commit => FND_API.G_FALSE,
1327: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1328: p_itemKey => l_itemKey,
1329: p_itemType => l_itemType,
1330: p_partner_id => p_party_relation_id,
1323: StartWorkflow
1324: ( p_api_version_number => 1.0,
1325: p_init_msg_list => FND_API.G_FALSE,
1326: p_commit => FND_API.G_FALSE,
1327: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
1328: p_itemKey => l_itemKey,
1329: p_itemType => l_itemType,
1330: p_partner_id => p_party_relation_id,
1331: p_partner_name => p_party_name,
1341: x_msg_count => x_msg_count,
1342: x_msg_data => x_msg_data);
1343:
1344: -- Check the x_return_status. If its not successful throw an exception.
1345: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1346: RAISE FND_API.G_EXC_ERROR;
1347: END IF;
1348:
1349: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1342: x_msg_data => x_msg_data);
1343:
1344: -- Check the x_return_status. If its not successful throw an exception.
1345: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1346: RAISE FND_API.G_EXC_ERROR;
1347: END IF;
1348:
1349: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
1350: fnd_message.Set_Name('PV', 'PV_DEBUG_MESSAGE');
1354:
1355: -- Call the following procedure to see whether workflow was able to send notification successfully.
1356: PV_ASSIGN_UTIL_PVT.checkforErrors
1357: (p_api_version_number => 1.0
1358: ,p_init_msg_list => FND_API.G_FALSE
1359: ,p_commit => FND_API.G_FALSE
1360: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1361: ,p_itemtype => l_itemType
1362: ,p_itemkey => l_itemKey
1355: -- Call the following procedure to see whether workflow was able to send notification successfully.
1356: PV_ASSIGN_UTIL_PVT.checkforErrors
1357: (p_api_version_number => 1.0
1358: ,p_init_msg_list => FND_API.G_FALSE
1359: ,p_commit => FND_API.G_FALSE
1360: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1361: ,p_itemtype => l_itemType
1362: ,p_itemkey => l_itemKey
1363: ,x_msg_count => x_msg_count
1356: PV_ASSIGN_UTIL_PVT.checkforErrors
1357: (p_api_version_number => 1.0
1358: ,p_init_msg_list => FND_API.G_FALSE
1359: ,p_commit => FND_API.G_FALSE
1360: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
1361: ,p_itemtype => l_itemType
1362: ,p_itemkey => l_itemKey
1363: ,x_msg_count => x_msg_count
1364: ,x_msg_data => x_msg_data
1364: ,x_msg_data => x_msg_data
1365: ,x_return_status => x_return_status);
1366:
1367: -- Check the x_return_status. If its not successful throw an exception.
1368: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1369: raise FND_API.G_EXC_ERROR;
1370: end if;
1371: END IF; -- No Channel Manager found
1372: END IF;
1365: ,x_return_status => x_return_status);
1366:
1367: -- Check the x_return_status. If its not successful throw an exception.
1368: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1369: raise FND_API.G_EXC_ERROR;
1370: end if;
1371: END IF; -- No Channel Manager found
1372: END IF;
1373:
1372: END IF;
1373:
1374: EXCEPTION
1375:
1376: WHEN FND_API.G_EXC_ERROR THEN
1377: x_return_status := FND_API.G_RET_STS_ERROR ;
1378: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1379: p_count => x_msg_count,
1380: p_data => x_msg_data);
1373:
1374: EXCEPTION
1375:
1376: WHEN FND_API.G_EXC_ERROR THEN
1377: x_return_status := FND_API.G_RET_STS_ERROR ;
1378: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1379: p_count => x_msg_count,
1380: p_data => x_msg_data);
1381: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1374: EXCEPTION
1375:
1376: WHEN FND_API.G_EXC_ERROR THEN
1377: x_return_status := FND_API.G_RET_STS_ERROR ;
1378: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1379: p_count => x_msg_count,
1380: p_data => x_msg_data);
1381: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1382: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1377: x_return_status := FND_API.G_RET_STS_ERROR ;
1378: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1379: p_count => x_msg_count,
1380: p_data => x_msg_data);
1381: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1382: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1383: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1384: p_count => x_msg_count,
1385: p_data => x_msg_data);
1378: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1379: p_count => x_msg_count,
1380: p_data => x_msg_data);
1381: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1382: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1383: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1384: p_count => x_msg_count,
1385: p_data => x_msg_data);
1386: WHEN OTHERS THEN
1379: p_count => x_msg_count,
1380: p_data => x_msg_data);
1381: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1382: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1383: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1384: p_count => x_msg_count,
1385: p_data => x_msg_data);
1386: WHEN OTHERS THEN
1387: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1383: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1384: p_count => x_msg_count,
1385: p_data => x_msg_data);
1386: WHEN OTHERS THEN
1387: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1388: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1389: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1390: p_count => x_msg_count,
1391: p_data => x_msg_data);
1385: p_data => x_msg_data);
1386: WHEN OTHERS THEN
1387: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1388: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1389: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1390: p_count => x_msg_count,
1391: p_data => x_msg_data);
1392: END Notify_CM_On_Create_Oppty;
1393:
1456: EXCEPTION
1457: WHEN OTHERS THEN
1458:
1459: fnd_msg_pub.Count_And_Get(
1460: p_encoded => FND_API.G_TRUE
1461: ,p_count => l_msg_count
1462: ,p_data => l_msg_data);
1463:
1464: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
1472: -- in order to avoid generating rosetta wrapper and for the easy debug
1473: -- Rivendell
1474: procedure NOTIFY_ON_UPDATE_OPPTY_JBES (
1475: p_api_version_number IN NUMBER,
1476: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1477: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1478: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1479: p_lead_id IN NUMBER,
1480: p_status IN VARCHAR2,
1473: -- Rivendell
1474: procedure NOTIFY_ON_UPDATE_OPPTY_JBES (
1475: p_api_version_number IN NUMBER,
1476: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1477: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1478: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1479: p_lead_id IN NUMBER,
1480: p_status IN VARCHAR2,
1481: p_lead_name IN VARCHAR2,
1474: procedure NOTIFY_ON_UPDATE_OPPTY_JBES (
1475: p_api_version_number IN NUMBER,
1476: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1477: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1478: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1479: p_lead_id IN NUMBER,
1480: p_status IN VARCHAR2,
1481: p_lead_name IN VARCHAR2,
1482: p_customer_id IN NUMBER,
1499: WHERE party_id = pc_party_id;
1500:
1501: BEGIN
1502: -- Standard call to check for call compatibility.
1503: IF NOT FND_API.Compatible_API_Call(l_api_version_number,
1504: p_api_version_number,
1505: l_api_name,
1506: G_PKG_NAME)
1507: THEN
1504: p_api_version_number,
1505: l_api_name,
1506: G_PKG_NAME)
1507: THEN
1508: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1509: END IF;
1510:
1511: -- Initialize message list if p_init_msg_list is set to TRUE.
1512: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1508: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1509: END IF;
1510:
1511: -- Initialize message list if p_init_msg_list is set to TRUE.
1512: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1513: fnd_msg_pub.initialize;
1514: END IF;
1515:
1516: -- Debug Message
1520: fnd_msg_pub.Add;
1521: END IF;
1522:
1523: -- Initialize API return status to success
1524: x_return_status := FND_API.G_RET_STS_SUCCESS;
1525:
1526: OPEN get_customer_name(p_customer_id);
1527: FETCH get_customer_name INTO l_opportunity_rec.customer_name;
1528: CLOSE get_customer_name;
1545: x_return_status => x_return_status,
1546: x_msg_count => x_msg_count,
1547: x_msg_data => x_msg_data);
1548:
1549: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1550: RAISE FND_API.G_EXC_ERROR;
1551: END IF;
1552:
1553: -- Standard call to get message count and if count is 1, get message info.
1546: x_msg_count => x_msg_count,
1547: x_msg_data => x_msg_data);
1548:
1549: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1550: RAISE FND_API.G_EXC_ERROR;
1551: END IF;
1552:
1553: -- Standard call to get message count and if count is 1, get message info.
1554: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1550: RAISE FND_API.G_EXC_ERROR;
1551: END IF;
1552:
1553: -- Standard call to get message count and if count is 1, get message info.
1554: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1555: p_count => x_msg_count,
1556: p_data => x_msg_data);
1557:
1558: EXCEPTION
1556: p_data => x_msg_data);
1557:
1558: EXCEPTION
1559:
1560: WHEN FND_API.G_EXC_ERROR THEN
1561:
1562: x_return_status := FND_API.G_RET_STS_ERROR ;
1563: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1564: p_count => x_msg_count,
1558: EXCEPTION
1559:
1560: WHEN FND_API.G_EXC_ERROR THEN
1561:
1562: x_return_status := FND_API.G_RET_STS_ERROR ;
1563: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1564: p_count => x_msg_count,
1565: p_data => x_msg_data);
1566:
1559:
1560: WHEN FND_API.G_EXC_ERROR THEN
1561:
1562: x_return_status := FND_API.G_RET_STS_ERROR ;
1563: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1564: p_count => x_msg_count,
1565: p_data => x_msg_data);
1566:
1567: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1563: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1564: p_count => x_msg_count,
1565: p_data => x_msg_data);
1566:
1567: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1568:
1569: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1570: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1571: p_count => x_msg_count,
1565: p_data => x_msg_data);
1566:
1567: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1568:
1569: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1570: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1571: p_count => x_msg_count,
1572: p_data => x_msg_data);
1573:
1566:
1567: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1568:
1569: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1570: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1571: p_count => x_msg_count,
1572: p_data => x_msg_data);
1573:
1574: WHEN OTHERS THEN
1577: fnd_message.Set_Token('TEXT', sqlcode||sqlerrm);
1578: fnd_msg_pub.Add;
1579: END IF;
1580:
1581: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1582:
1583: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1584: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1585: p_count => x_msg_count,
1580:
1581: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1582:
1583: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1584: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
1585: p_count => x_msg_count,
1586: p_data => x_msg_data);
1587:
1588: END NOTIFY_ON_UPDATE_OPPTY_JBES;
1589:
1590: -- Opportunity modify User Hook.
1591: procedure Notify_Party_On_Update_Oppty (
1592: p_api_version_number IN NUMBER,
1593: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1594: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1595: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1596: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
1597: p_salesforce_id IN NUMBER,
1590: -- Opportunity modify User Hook.
1591: procedure Notify_Party_On_Update_Oppty (
1592: p_api_version_number IN NUMBER,
1593: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1594: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1595: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1596: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
1597: p_salesforce_id IN NUMBER,
1598: x_return_status OUT NOCOPY VARCHAR2,
1591: procedure Notify_Party_On_Update_Oppty (
1592: p_api_version_number IN NUMBER,
1593: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1594: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1595: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1596: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
1597: p_salesforce_id IN NUMBER,
1598: x_return_status OUT NOCOPY VARCHAR2,
1599: x_msg_count OUT NOCOPY NUMBER,
1791:
1792: BEGIN
1793:
1794: -- Standard call to check for call compatibility.
1795: IF NOT FND_API.Compatible_API_Call(l_api_version_number,
1796: p_api_version_number,
1797: l_api_name,
1798: G_PKG_NAME)
1799: THEN
1796: p_api_version_number,
1797: l_api_name,
1798: G_PKG_NAME)
1799: THEN
1800: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1801: END IF;
1802:
1803: -- Initialize message list if p_init_msg_list is set to TRUE.
1804: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1800: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1801: END IF;
1802:
1803: -- Initialize message list if p_init_msg_list is set to TRUE.
1804: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1805: fnd_msg_pub.initialize;
1806: END IF;
1807:
1808: -- Debug Message
1812: fnd_msg_pub.Add;
1813: END IF;
1814:
1815: -- Initialize API return status to success
1816: x_return_status := FND_API.G_RET_STS_SUCCESS;
1817:
1818: OPEN lc_assign_ids (pc_lead_id => l_lead_id);
1819: FETCH lc_assign_ids INTO l_workflow_id,l_wf_item_key, l_wf_item_type;
1820:
1940: x_return_status => x_return_status,
1941: x_msg_count => x_msg_count,
1942: x_msg_data => x_msg_data);
1943:
1944: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1945: raise FND_API.G_EXC_ERROR;
1946: end if;
1947: end loop;
1948:
1941: x_msg_count => x_msg_count,
1942: x_msg_data => x_msg_data);
1943:
1944: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1945: raise FND_API.G_EXC_ERROR;
1946: end if;
1947: end loop;
1948:
1949: end if;
2029:
2030: END IF;
2031:
2032: -- Check the x_return_status. If its not successful throw an exception.
2033: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
2034: CLOSE lc_assign_ids;
2035: RAISE FND_API.G_EXC_ERROR;
2036: END IF;
2037:
2031:
2032: -- Check the x_return_status. If its not successful throw an exception.
2033: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
2034: CLOSE lc_assign_ids;
2035: RAISE FND_API.G_EXC_ERROR;
2036: END IF;
2037:
2038: END IF; -- If Assignment has been started
2039: CLOSE lc_assign_ids;
2038: END IF; -- If Assignment has been started
2039: CLOSE lc_assign_ids;
2040:
2041: -- Standard call to get message count and if count is 1, get message info.
2042: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2043: p_count => x_msg_count,
2044: p_data => x_msg_data);
2045:
2046: EXCEPTION
2044: p_data => x_msg_data);
2045:
2046: EXCEPTION
2047:
2048: WHEN FND_API.G_EXC_ERROR THEN
2049:
2050: x_return_status := FND_API.G_RET_STS_ERROR ;
2051: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2052: p_count => x_msg_count,
2046: EXCEPTION
2047:
2048: WHEN FND_API.G_EXC_ERROR THEN
2049:
2050: x_return_status := FND_API.G_RET_STS_ERROR ;
2051: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2052: p_count => x_msg_count,
2053: p_data => x_msg_data);
2054:
2047:
2048: WHEN FND_API.G_EXC_ERROR THEN
2049:
2050: x_return_status := FND_API.G_RET_STS_ERROR ;
2051: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2052: p_count => x_msg_count,
2053: p_data => x_msg_data);
2054:
2055: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2051: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2052: p_count => x_msg_count,
2053: p_data => x_msg_data);
2054:
2055: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2056:
2057: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2058: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2059: p_count => x_msg_count,
2053: p_data => x_msg_data);
2054:
2055: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2056:
2057: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2058: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2059: p_count => x_msg_count,
2060: p_data => x_msg_data);
2061:
2054:
2055: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2056:
2057: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2058: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2059: p_count => x_msg_count,
2060: p_data => x_msg_data);
2061:
2062: WHEN OTHERS THEN
2065: fnd_message.Set_Token('TEXT', sqlcode||sqlerrm);
2066: fnd_msg_pub.Add;
2067: END IF;
2068:
2069: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2070:
2071: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2072: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2073: p_count => x_msg_count,
2068:
2069: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2070:
2071: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2072: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2073: p_count => x_msg_count,
2074: p_data => x_msg_data);
2075:
2076: END Notify_Party_On_Update_Oppty;
2228: EXCEPTION
2229: WHEN OTHERS THEN
2230:
2231: fnd_msg_pub.Count_And_Get(
2232: p_encoded => FND_API.G_TRUE
2233: ,p_count => l_msg_count
2234: ,p_data => l_msg_data);
2235:
2236: wf_core.context(G_PKG_NAME, l_api_name,l_msg_data);
2244: /* Call the Create Opportunity user hook. *********/
2245: /***************************************************/
2246: procedure Create_Opportunity_Post (
2247: p_api_version_number IN NUMBER,
2248: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2249: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2250: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2251: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
2252: p_salesforce_id IN NUMBER,
2245: /***************************************************/
2246: procedure Create_Opportunity_Post (
2247: p_api_version_number IN NUMBER,
2248: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2249: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2250: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2251: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
2252: p_salesforce_id IN NUMBER,
2253: x_return_status OUT NOCOPY VARCHAR2,
2246: procedure Create_Opportunity_Post (
2247: p_api_version_number IN NUMBER,
2248: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2249: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2250: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2251: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
2252: p_salesforce_id IN NUMBER,
2253: x_return_status OUT NOCOPY VARCHAR2,
2254: x_msg_count OUT NOCOPY NUMBER,
2275: /** conatct or VAD contact */
2276: /***************************************************************************/
2277:
2278: -- Initialize message list if p_init_msg_list is set to TRUE.
2279: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2280: fnd_msg_pub.initialize;
2281: END IF;
2282:
2283: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2279: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2280: fnd_msg_pub.initialize;
2281: END IF;
2282:
2283: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2284: fnd_msg_pub.initialize;
2285: END IF;
2286:
2287: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2291: fnd_msg_pub.Add;
2292: END IF;
2293:
2294: -- Initialize API return status to success
2295: x_return_status := FND_API.G_RET_STS_SUCCESS;
2296:
2297: get_user_info
2298: ( p_salesforce_id => p_salesforce_id,
2299: p_channel_code => l_channel_code,
2306: x_msg_count => x_msg_count,
2307: x_msg_data => x_msg_data
2308: );
2309:
2310: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2311: raise FND_API.G_EXC_ERROR;
2312: end if;
2313:
2314: -- -----------------------------------------------------------------
2307: x_msg_data => x_msg_data
2308: );
2309:
2310: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2311: raise FND_API.G_EXC_ERROR;
2312: end if;
2313:
2314: -- -----------------------------------------------------------------
2315: -- Find out the channel type of the opportunity: DIRECT or INDIRECT.
2351: x_return_status => x_return_status,
2352: x_msg_count => x_msg_count,
2353: x_msg_data => x_msg_data);
2354:
2355: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2356: raise FND_API.G_EXC_ERROR;
2357: end if;
2358:
2359: end if;
2352: x_msg_count => x_msg_count,
2353: x_msg_data => x_msg_data);
2354:
2355: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2356: raise FND_API.G_EXC_ERROR;
2357: end if;
2358:
2359: end if;
2360:
2361: end if;
2362: END IF; -- l_indirect_channel_flag = 'Y'
2363:
2364: EXCEPTION
2365: WHEN FND_API.G_EXC_ERROR THEN
2366:
2367: x_return_status := FND_API.G_RET_STS_ERROR ;
2368: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2369: p_count => x_msg_count,
2363:
2364: EXCEPTION
2365: WHEN FND_API.G_EXC_ERROR THEN
2366:
2367: x_return_status := FND_API.G_RET_STS_ERROR ;
2368: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2369: p_count => x_msg_count,
2370: p_data => x_msg_data);
2371:
2364: EXCEPTION
2365: WHEN FND_API.G_EXC_ERROR THEN
2366:
2367: x_return_status := FND_API.G_RET_STS_ERROR ;
2368: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2369: p_count => x_msg_count,
2370: p_data => x_msg_data);
2371:
2372: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2368: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2369: p_count => x_msg_count,
2370: p_data => x_msg_data);
2371:
2372: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2373:
2374: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2375: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2376: p_count => x_msg_count,
2370: p_data => x_msg_data);
2371:
2372: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2373:
2374: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2375: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2376: p_count => x_msg_count,
2377: p_data => x_msg_data);
2378:
2371:
2372: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2373:
2374: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2375: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2376: p_count => x_msg_count,
2377: p_data => x_msg_data);
2378:
2379: WHEN OTHERS THEN
2377: p_data => x_msg_data);
2378:
2379: WHEN OTHERS THEN
2380:
2381: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2382: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2383: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2384: p_count => x_msg_count,
2385: p_data => x_msg_data);
2379: WHEN OTHERS THEN
2380:
2381: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2382: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2383: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2384: p_count => x_msg_count,
2385: p_data => x_msg_data);
2386:
2387: end Create_Opportunity_Post;
2391: /* Call the Update Opportunity user hook. *********/
2392: /***************************************************/
2393: procedure Update_Opportunity_Pre (
2394: p_api_version_number IN NUMBER,
2395: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2396: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2397: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2398: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
2399: p_salesforce_id IN NUMBER,
2392: /***************************************************/
2393: procedure Update_Opportunity_Pre (
2394: p_api_version_number IN NUMBER,
2395: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2396: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2397: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2398: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
2399: p_salesforce_id IN NUMBER,
2400: x_return_status OUT NOCOPY VARCHAR2,
2393: procedure Update_Opportunity_Pre (
2394: p_api_version_number IN NUMBER,
2395: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2396: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2397: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2398: p_oppty_header_rec IN AS_OPPORTUNITY_PUB.header_rec_type,
2399: p_salesforce_id IN NUMBER,
2400: x_return_status OUT NOCOPY VARCHAR2,
2401: x_msg_count OUT NOCOPY NUMBER,
2420: /** contact or VAD contact */
2421: /***************************************************************************/
2422:
2423: -- Initialize message list if p_init_msg_list is set to TRUE.
2424: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2425: fnd_msg_pub.initialize;
2426: END IF;
2427:
2428: IF fnd_msg_pub.Check_Msg_Level (fnd_msg_pub.G_MSG_LVL_DEBUG_LOW) THEN
2431: fnd_msg_pub.Add;
2432: END IF;
2433:
2434: -- Initialize API return status to success
2435: x_return_status := FND_API.G_RET_STS_SUCCESS;
2436:
2437: get_user_info
2438: ( p_salesforce_id => p_salesforce_id,
2439: p_channel_code => l_channel_code,
2446: x_msg_count => x_msg_count,
2447: x_msg_data => x_msg_data
2448: );
2449:
2450: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2451: raise FND_API.G_EXC_ERROR;
2452: end if;
2453:
2454: if p_oppty_header_rec.source_promotion_id is not null then
2447: x_msg_data => x_msg_data
2448: );
2449:
2450: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2451: raise FND_API.G_EXC_ERROR;
2452: end if;
2453:
2454: if p_oppty_header_rec.source_promotion_id is not null then
2455:
2463: x_return_status => x_return_status,
2464: x_msg_count => x_msg_count,
2465: x_msg_data => x_msg_data);
2466:
2467: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2468: raise FND_API.G_EXC_ERROR;
2469: end if;
2470:
2471: end if;
2464: x_msg_count => x_msg_count,
2465: x_msg_data => x_msg_data);
2466:
2467: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2468: raise FND_API.G_EXC_ERROR;
2469: end if;
2470:
2471: end if;
2472:
2480: x_return_status => x_return_status,
2481: x_msg_count => x_msg_count,
2482: x_msg_data => x_msg_data);
2483:
2484: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2485: raise FND_API.G_EXC_ERROR;
2486: end if;
2487:
2488: exception
2481: x_msg_count => x_msg_count,
2482: x_msg_data => x_msg_data);
2483:
2484: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2485: raise FND_API.G_EXC_ERROR;
2486: end if;
2487:
2488: exception
2489: WHEN FND_API.G_EXC_ERROR THEN
2485: raise FND_API.G_EXC_ERROR;
2486: end if;
2487:
2488: exception
2489: WHEN FND_API.G_EXC_ERROR THEN
2490:
2491: x_return_status := FND_API.G_RET_STS_ERROR ;
2492: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2493: p_count => x_msg_count,
2487:
2488: exception
2489: WHEN FND_API.G_EXC_ERROR THEN
2490:
2491: x_return_status := FND_API.G_RET_STS_ERROR ;
2492: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2493: p_count => x_msg_count,
2494: p_data => x_msg_data);
2495:
2488: exception
2489: WHEN FND_API.G_EXC_ERROR THEN
2490:
2491: x_return_status := FND_API.G_RET_STS_ERROR ;
2492: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2493: p_count => x_msg_count,
2494: p_data => x_msg_data);
2495:
2496: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2492: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2493: p_count => x_msg_count,
2494: p_data => x_msg_data);
2495:
2496: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2497:
2498: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2499: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2500: p_count => x_msg_count,
2494: p_data => x_msg_data);
2495:
2496: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2497:
2498: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2499: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2500: p_count => x_msg_count,
2501: p_data => x_msg_data);
2502:
2495:
2496: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2497:
2498: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2499: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2500: p_count => x_msg_count,
2501: p_data => x_msg_data);
2502:
2503: WHEN no_data_found THEN
2505: fnd_message.Set_Token('TEXT', 'Current resource does not have a login user assigned. '||
2506: 'Please use resource manager to assign a login user to this resource ');
2507: fnd_msg_pub.Add;
2508:
2509: x_return_status := FND_API.G_RET_STS_ERROR ;
2510: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2511: p_count => x_msg_count,
2512: p_data => x_msg_data);
2513:
2506: 'Please use resource manager to assign a login user to this resource ');
2507: fnd_msg_pub.Add;
2508:
2509: x_return_status := FND_API.G_RET_STS_ERROR ;
2510: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2511: p_count => x_msg_count,
2512: p_data => x_msg_data);
2513:
2514: WHEN OTHERS THEN
2512: p_data => x_msg_data);
2513:
2514: WHEN OTHERS THEN
2515:
2516: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2517: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2518: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2519: p_count => x_msg_count,
2520: p_data => x_msg_data);
2514: WHEN OTHERS THEN
2515:
2516: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2517: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2518: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2519: p_count => x_msg_count,
2520: p_data => x_msg_data);
2521:
2522: end Update_Opportunity_Pre;
2590: debug('In '||l_api_name);
2591: END IF;
2592:
2593: -- Initialize API return status to success
2594: x_return_status := FND_API.G_RET_STS_SUCCESS;
2595:
2596: -- Get the Party id of the relation from based on the resource id
2597: SELECT js.source_id, fu.user_name, js.category
2598: INTO l_party_id, x_user_name, l_resource_category
2654:
2655: if (l_channel_flag = null or l_channel_flag = 'N') then
2656: fnd_message.SET_NAME('PV', 'PV_INVALID_CHANNEL_CODE');
2657: fnd_msg_pub.ADD;
2658: raise FND_API.G_EXC_ERROR;
2659: end if;
2660:
2661: end if;
2662:
2660:
2661: end if;
2662:
2663: exception
2664: WHEN FND_API.G_EXC_ERROR THEN
2665:
2666: x_return_status := FND_API.G_RET_STS_ERROR ;
2667: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2668: p_count => x_msg_count,
2662:
2663: exception
2664: WHEN FND_API.G_EXC_ERROR THEN
2665:
2666: x_return_status := FND_API.G_RET_STS_ERROR ;
2667: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2668: p_count => x_msg_count,
2669: p_data => x_msg_data);
2670:
2663: exception
2664: WHEN FND_API.G_EXC_ERROR THEN
2665:
2666: x_return_status := FND_API.G_RET_STS_ERROR ;
2667: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2668: p_count => x_msg_count,
2669: p_data => x_msg_data);
2670:
2671: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2667: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2668: p_count => x_msg_count,
2669: p_data => x_msg_data);
2670:
2671: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2672:
2673: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2674: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2675: p_count => x_msg_count,
2669: p_data => x_msg_data);
2670:
2671: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2672:
2673: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2674: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2675: p_count => x_msg_count,
2676: p_data => x_msg_data);
2677:
2670:
2671: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2672:
2673: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2674: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2675: p_count => x_msg_count,
2676: p_data => x_msg_data);
2677:
2678: WHEN no_data_found THEN
2680: fnd_message.Set_Token('TEXT', 'Current resource does not have a login user assigned. '||
2681: 'Please use resource manager to assign a login user to this resource ');
2682: fnd_msg_pub.Add;
2683:
2684: x_return_status := FND_API.G_RET_STS_ERROR ;
2685: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2686: p_count => x_msg_count,
2687: p_data => x_msg_data);
2688:
2681: 'Please use resource manager to assign a login user to this resource ');
2682: fnd_msg_pub.Add;
2683:
2684: x_return_status := FND_API.G_RET_STS_ERROR ;
2685: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2686: p_count => x_msg_count,
2687: p_data => x_msg_data);
2688:
2689:
2689:
2690:
2691: WHEN OTHERS THEN
2692:
2693: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2694: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2695: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2696: p_count => x_msg_count,
2697: p_data => x_msg_data);
2691: WHEN OTHERS THEN
2692:
2693: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2694: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
2695: fnd_msg_pub.Count_And_Get( p_encoded => FND_API.G_TRUE,
2696: p_count => x_msg_count,
2697: p_data => x_msg_data);
2698: end get_user_info;
2699: