29: AMS_DEBUG_MEDIUM_ON CONSTANT boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM);
30:
31: PROCEDURE Create_Cnt_Point(
32: p_api_version_number IN NUMBER,
33: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
34: p_commit IN VARCHAR2 := FND_API.G_FALSE,
35: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
36:
37: x_return_status OUT NOCOPY VARCHAR2,
30:
31: PROCEDURE Create_Cnt_Point(
32: p_api_version_number IN NUMBER,
33: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
34: p_commit IN VARCHAR2 := FND_API.G_FALSE,
35: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
36:
37: x_return_status OUT NOCOPY VARCHAR2,
38: x_msg_count OUT NOCOPY NUMBER,
31: PROCEDURE Create_Cnt_Point(
32: p_api_version_number IN NUMBER,
33: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
34: p_commit IN VARCHAR2 := FND_API.G_FALSE,
35: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
36:
37: x_return_status OUT NOCOPY VARCHAR2,
38: x_msg_count OUT NOCOPY NUMBER,
39: x_msg_data OUT NOCOPY VARCHAR2,
46: L_API_NAME CONSTANT VARCHAR2(30) := 'Create_Cnt_Point';
47: L_API_VERSION_NUMBER CONSTANT NUMBER := 1.0;
48: l_return_status_full VARCHAR2(1);
49: l_object_version_number NUMBER := 1;
50: l_org_id NUMBER := FND_API.G_MISS_NUM;
51: l_CONTACT_POINT_ID NUMBER;
52: l_dummy NUMBER;
53:
54: CURSOR c_id IS
76: AMS_UTILITY_PVT.debug_message('Save point : CREATE_Cnt_Point_PVT created');
77: END IF;
78:
79: -- Standard call to check for call compatibility.
80: IF NOT FND_API.Compatible_API_Call ( L_API_VERSION_NUMBER,
81: p_api_version_number,
82: l_api_name,
83: G_PKG_NAME)
84: THEN
81: p_api_version_number,
82: l_api_name,
83: G_PKG_NAME)
84: THEN
85: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
86: END IF;
87:
88: -- Initialize message list if p_init_msg_list is set to TRUE.
89: IF FND_API.to_Boolean( p_init_msg_list )
85: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
86: END IF;
87:
88: -- Initialize message list if p_init_msg_list is set to TRUE.
89: IF FND_API.to_Boolean( p_init_msg_list )
90: THEN
91: FND_MSG_PUB.initialize;
92: END IF;
93:
102: END IF;
103:
104:
105: -- Initialize API return status to SUCCESS
106: x_return_status := FND_API.G_RET_STS_SUCCESS;
107:
108: -- Local variable initialization
109:
110: IF p_cnt_point_rec.CONTACT_POINT_ID IS NULL OR p_cnt_point_rec.CONTACT_POINT_ID = FND_API.g_miss_num THEN
106: x_return_status := FND_API.G_RET_STS_SUCCESS;
107:
108: -- Local variable initialization
109:
110: IF p_cnt_point_rec.CONTACT_POINT_ID IS NULL OR p_cnt_point_rec.CONTACT_POINT_ID = FND_API.g_miss_num THEN
111: LOOP
112: l_dummy := NULL;
113: OPEN c_id;
114: FETCH c_id INTO l_CONTACT_POINT_ID;
134: -- Validate Environment
135: -- =========================================================================
136:
137:
138: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
139: THEN
140: -- Debug message
141: IF (AMS_DEBUG_HIGH_ON) THEN
142:
149: -- Invoke validation procedures
150:
151: Validate_cnt_point(
152: p_api_version_number => 1.0,
153: p_init_msg_list => FND_API.G_FALSE,
154: p_validation_level => p_validation_level,
155: p_validation_mode => JTF_PLSQL_API.g_create,
156: p_cnt_point_rec => p_cnt_point_rec,
157: x_return_status => x_return_status,
159: x_msg_data => x_msg_data);
160:
161: END IF;
162:
163: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
164: RAISE FND_API.G_EXC_ERROR;
165: END IF;
166:
167:
160:
161: END IF;
162:
163: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
164: RAISE FND_API.G_EXC_ERROR;
165: END IF;
166:
167:
168: -- Debug Message
204: p_attribute14 => p_cnt_point_rec.attribute14,
205: p_attribute15 => p_cnt_point_rec.attribute15,
206: p_contact_point_value_id => p_cnt_point_rec.contact_point_value_id
207: );
208: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
209: RAISE FND_API.G_EXC_ERROR;
210: ELSE
211: x_contact_point_id := l_contact_point_id;
212: END IF;
205: p_attribute15 => p_cnt_point_rec.attribute15,
206: p_contact_point_value_id => p_cnt_point_rec.contact_point_value_id
207: );
208: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
209: RAISE FND_API.G_EXC_ERROR;
210: ELSE
211: x_contact_point_id := l_contact_point_id;
212: END IF;
213: --
214: -- End of API body
215: --
216:
217: -- Standard check for p_commit
218: IF FND_API.to_Boolean( p_commit )
219: THEN
220: COMMIT WORK;
221: END IF;
222:
234: );
235: EXCEPTION
236:
237: WHEN AMS_Utility_PVT.resource_locked THEN
238: x_return_status := FND_API.g_ret_sts_error;
239: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
240:
241: WHEN FND_API.G_EXC_ERROR THEN
242: ROLLBACK TO CREATE_Cnt_Point_PVT;
237: WHEN AMS_Utility_PVT.resource_locked THEN
238: x_return_status := FND_API.g_ret_sts_error;
239: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
240:
241: WHEN FND_API.G_EXC_ERROR THEN
242: ROLLBACK TO CREATE_Cnt_Point_PVT;
243: x_return_status := FND_API.G_RET_STS_ERROR;
244: -- Standard call to get message count and if count=1, get the message
245: FND_MSG_PUB.Count_And_Get (
239: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
240:
241: WHEN FND_API.G_EXC_ERROR THEN
242: ROLLBACK TO CREATE_Cnt_Point_PVT;
243: x_return_status := FND_API.G_RET_STS_ERROR;
244: -- Standard call to get message count and if count=1, get the message
245: FND_MSG_PUB.Count_And_Get (
246: p_encoded => FND_API.G_FALSE,
247: p_count => x_msg_count,
242: ROLLBACK TO CREATE_Cnt_Point_PVT;
243: x_return_status := FND_API.G_RET_STS_ERROR;
244: -- Standard call to get message count and if count=1, get the message
245: FND_MSG_PUB.Count_And_Get (
246: p_encoded => FND_API.G_FALSE,
247: p_count => x_msg_count,
248: p_data => x_msg_data
249: );
250:
247: p_count => x_msg_count,
248: p_data => x_msg_data
249: );
250:
251: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
252: ROLLBACK TO CREATE_Cnt_Point_PVT;
253: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
254: -- Standard call to get message count and if count=1, get the message
255: FND_MSG_PUB.Count_And_Get (
249: );
250:
251: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
252: ROLLBACK TO CREATE_Cnt_Point_PVT;
253: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
254: -- Standard call to get message count and if count=1, get the message
255: FND_MSG_PUB.Count_And_Get (
256: p_encoded => FND_API.G_FALSE,
257: p_count => x_msg_count,
252: ROLLBACK TO CREATE_Cnt_Point_PVT;
253: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
254: -- Standard call to get message count and if count=1, get the message
255: FND_MSG_PUB.Count_And_Get (
256: p_encoded => FND_API.G_FALSE,
257: p_count => x_msg_count,
258: p_data => x_msg_data
259: );
260:
259: );
260:
261: WHEN OTHERS THEN
262: ROLLBACK TO CREATE_Cnt_Point_PVT;
263: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
264: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
265: THEN
266: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
267: END IF;
266: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
267: END IF;
268: -- Standard call to get message count and if count=1, get the message
269: FND_MSG_PUB.Count_And_Get (
270: p_encoded => FND_API.G_FALSE,
271: p_count => x_msg_count,
272: p_data => x_msg_data
273: );
274: End Create_Cnt_Point;
275:
276:
277: PROCEDURE Update_Cnt_Point(
278: p_api_version_number IN NUMBER,
279: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
280: p_commit IN VARCHAR2 := FND_API.G_FALSE,
281: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
282:
283:
276:
277: PROCEDURE Update_Cnt_Point(
278: p_api_version_number IN NUMBER,
279: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
280: p_commit IN VARCHAR2 := FND_API.G_FALSE,
281: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
282:
283:
284: x_return_status OUT NOCOPY VARCHAR2,
277: PROCEDURE Update_Cnt_Point(
278: p_api_version_number IN NUMBER,
279: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
280: p_commit IN VARCHAR2 := FND_API.G_FALSE,
281: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
282:
283:
284: x_return_status OUT NOCOPY VARCHAR2,
285: x_msg_count OUT NOCOPY NUMBER,
314: -- Standard Start of API savepoint
315: SAVEPOINT UPDATE_Cnt_Point_PVT;
316:
317: -- Standard call to check for call compatibility.
318: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
319: p_api_version_number,
320: l_api_name,
321: G_PKG_NAME)
322: THEN
319: p_api_version_number,
320: l_api_name,
321: G_PKG_NAME)
322: THEN
323: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
324: END IF;
325:
326: -- Initialize message list if p_init_msg_list is set to TRUE.
327: IF FND_API.to_Boolean( p_init_msg_list )
323: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
324: END IF;
325:
326: -- Initialize message list if p_init_msg_list is set to TRUE.
327: IF FND_API.to_Boolean( p_init_msg_list )
328: THEN
329: FND_MSG_PUB.initialize;
330: END IF;
331:
336: END IF;
337:
338:
339: -- Initialize API return status to SUCCESS
340: x_return_status := FND_API.G_RET_STS_SUCCESS;
341:
342: -- Debug Message
343: IF (AMS_DEBUG_HIGH_ON) THEN
344:
353: If ( c_get_Cnt_Point%NOTFOUND) THEN
354: AMS_Utility_PVT.Error_Message(p_message_name => 'API_MISSING_UPDATE_TARGET',
355: p_token_name => 'INFO',
356: p_token_value => 'Cnt_Point') ;
357: RAISE FND_API.G_EXC_ERROR;
358: END IF;
359: -- Debug Message
360: IF (AMS_DEBUG_HIGH_ON) THEN
361:
365:
366:
367:
368: If (l_tar_cnt_point_rec.object_version_number is NULL or
369: l_tar_cnt_point_rec.object_version_number = FND_API.G_MISS_NUM ) Then
370: AMS_Utility_PVT.Error_Message(p_message_name => 'API_VERSION_MISSING',
371: p_token_name => 'COLUMN',
372: p_token_value => 'Last_Update_Date') ;
373: raise FND_API.G_EXC_ERROR;
369: l_tar_cnt_point_rec.object_version_number = FND_API.G_MISS_NUM ) Then
370: AMS_Utility_PVT.Error_Message(p_message_name => 'API_VERSION_MISSING',
371: p_token_name => 'COLUMN',
372: p_token_value => 'Last_Update_Date') ;
373: raise FND_API.G_EXC_ERROR;
374: End if;
375: -- Check Whether record has been changed by someone else
376: If (l_tar_cnt_point_rec.object_version_number <> l_ref_cnt_point_rec.object_version_number) Then
377: AMS_Utility_PVT.Error_Message(p_message_name => 'API_RECORD_CHANGED',
376: If (l_tar_cnt_point_rec.object_version_number <> l_ref_cnt_point_rec.object_version_number) Then
377: AMS_Utility_PVT.Error_Message(p_message_name => 'API_RECORD_CHANGED',
378: p_token_name => 'INFO',
379: p_token_value => 'Cnt_Point') ;
380: raise FND_API.G_EXC_ERROR;
381: End if;
382: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
383: THEN
384: -- Debug message
378: p_token_name => 'INFO',
379: p_token_value => 'Cnt_Point') ;
380: raise FND_API.G_EXC_ERROR;
381: End if;
382: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
383: THEN
384: -- Debug message
385: IF (AMS_DEBUG_HIGH_ON) THEN
386:
389:
390: -- Invoke validation procedures
391: Validate_cnt_point(
392: p_api_version_number => 1.0,
393: p_init_msg_list => FND_API.G_FALSE,
394: p_validation_level => p_validation_level,
395: p_validation_mode => JTF_PLSQL_API.g_update,
396: p_cnt_point_rec => p_cnt_point_rec,
397: x_return_status => x_return_status,
398: x_msg_count => x_msg_count,
399: x_msg_data => x_msg_data);
400: END IF;
401:
402: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
403: RAISE FND_API.G_EXC_ERROR;
404: END IF;
405:
406:
399: x_msg_data => x_msg_data);
400: END IF;
401:
402: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
403: RAISE FND_API.G_EXC_ERROR;
404: END IF;
405:
406:
407: -- Debug Message
446: -- End of API body.
447: --
448:
449: -- Standard check for p_commit
450: IF FND_API.to_Boolean( p_commit )
451: THEN
452: COMMIT WORK;
453: END IF;
454:
466: );
467: EXCEPTION
468:
469: WHEN AMS_Utility_PVT.resource_locked THEN
470: x_return_status := FND_API.g_ret_sts_error;
471: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
472:
473: WHEN FND_API.G_EXC_ERROR THEN
474: ROLLBACK TO UPDATE_Cnt_Point_PVT;
469: WHEN AMS_Utility_PVT.resource_locked THEN
470: x_return_status := FND_API.g_ret_sts_error;
471: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
472:
473: WHEN FND_API.G_EXC_ERROR THEN
474: ROLLBACK TO UPDATE_Cnt_Point_PVT;
475: x_return_status := FND_API.G_RET_STS_ERROR;
476: -- Standard call to get message count and if count=1, get the message
477: FND_MSG_PUB.Count_And_Get (
471: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
472:
473: WHEN FND_API.G_EXC_ERROR THEN
474: ROLLBACK TO UPDATE_Cnt_Point_PVT;
475: x_return_status := FND_API.G_RET_STS_ERROR;
476: -- Standard call to get message count and if count=1, get the message
477: FND_MSG_PUB.Count_And_Get (
478: p_encoded => FND_API.G_FALSE,
479: p_count => x_msg_count,
474: ROLLBACK TO UPDATE_Cnt_Point_PVT;
475: x_return_status := FND_API.G_RET_STS_ERROR;
476: -- Standard call to get message count and if count=1, get the message
477: FND_MSG_PUB.Count_And_Get (
478: p_encoded => FND_API.G_FALSE,
479: p_count => x_msg_count,
480: p_data => x_msg_data
481: );
482:
479: p_count => x_msg_count,
480: p_data => x_msg_data
481: );
482:
483: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
484: ROLLBACK TO UPDATE_Cnt_Point_PVT;
485: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
486: -- Standard call to get message count and if count=1, get the message
487: FND_MSG_PUB.Count_And_Get (
481: );
482:
483: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
484: ROLLBACK TO UPDATE_Cnt_Point_PVT;
485: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
486: -- Standard call to get message count and if count=1, get the message
487: FND_MSG_PUB.Count_And_Get (
488: p_encoded => FND_API.G_FALSE,
489: p_count => x_msg_count,
484: ROLLBACK TO UPDATE_Cnt_Point_PVT;
485: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
486: -- Standard call to get message count and if count=1, get the message
487: FND_MSG_PUB.Count_And_Get (
488: p_encoded => FND_API.G_FALSE,
489: p_count => x_msg_count,
490: p_data => x_msg_data
491: );
492:
491: );
492:
493: WHEN OTHERS THEN
494: ROLLBACK TO UPDATE_Cnt_Point_PVT;
495: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
496: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
497: THEN
498: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
499: END IF;
498: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
499: END IF;
500: -- Standard call to get message count and if count=1, get the message
501: FND_MSG_PUB.Count_And_Get (
502: p_encoded => FND_API.G_FALSE,
503: p_count => x_msg_count,
504: p_data => x_msg_data
505: );
506: End Update_Cnt_Point;
507:
508:
509: PROCEDURE Delete_Cnt_Point(
510: p_api_version_number IN NUMBER,
511: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
512: p_commit IN VARCHAR2 := FND_API.G_FALSE,
513: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
514: x_return_status OUT NOCOPY VARCHAR2,
515: x_msg_count OUT NOCOPY NUMBER,
508:
509: PROCEDURE Delete_Cnt_Point(
510: p_api_version_number IN NUMBER,
511: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
512: p_commit IN VARCHAR2 := FND_API.G_FALSE,
513: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
514: x_return_status OUT NOCOPY VARCHAR2,
515: x_msg_count OUT NOCOPY NUMBER,
516: x_msg_data OUT NOCOPY VARCHAR2,
509: PROCEDURE Delete_Cnt_Point(
510: p_api_version_number IN NUMBER,
511: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
512: p_commit IN VARCHAR2 := FND_API.G_FALSE,
513: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
514: x_return_status OUT NOCOPY VARCHAR2,
515: x_msg_count OUT NOCOPY NUMBER,
516: x_msg_data OUT NOCOPY VARCHAR2,
517: p_contact_point_id IN NUMBER,
539: -- Standard Start of API savepoint
540: SAVEPOINT DELETE_Cnt_Point_PVT;
541:
542: -- Standard call to check for call compatibility.
543: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
544: p_api_version_number,
545: l_api_name,
546: G_PKG_NAME)
547: THEN
544: p_api_version_number,
545: l_api_name,
546: G_PKG_NAME)
547: THEN
548: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
549: END IF;
550:
551: -- Initialize message list if p_init_msg_list is set to TRUE.
552: IF FND_API.to_Boolean( p_init_msg_list )
548: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
549: END IF;
550:
551: -- Initialize message list if p_init_msg_list is set to TRUE.
552: IF FND_API.to_Boolean( p_init_msg_list )
553: THEN
554: FND_MSG_PUB.initialize;
555: END IF;
556:
566:
567: IF (c_Cnt_Point%NOTFOUND) THEN
568: CLOSE c_Cnt_Point;
569: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RECORD_NOT_FOUND');
570: RAISE FND_API.g_exc_error;
571: END IF;
572:
573: CLOSE c_Cnt_Point;
574:
573: CLOSE c_Cnt_Point;
574:
575:
576: -- Initialize API return status to SUCCESS
577: x_return_status := FND_API.G_RET_STS_SUCCESS;
578:
579: --
580: -- Api body
581: --
592: -- End of API body
593: --
594:
595: -- Standard check for p_commit
596: IF FND_API.to_Boolean( p_commit )
597: THEN
598: COMMIT WORK;
599: END IF;
600:
614: );
615: EXCEPTION
616:
617: WHEN AMS_Utility_PVT.resource_locked THEN
618: x_return_status := FND_API.g_ret_sts_error;
619: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
620:
621: WHEN FND_API.G_EXC_ERROR THEN
622: ROLLBACK TO DELETE_Cnt_Point_PVT;
617: WHEN AMS_Utility_PVT.resource_locked THEN
618: x_return_status := FND_API.g_ret_sts_error;
619: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
620:
621: WHEN FND_API.G_EXC_ERROR THEN
622: ROLLBACK TO DELETE_Cnt_Point_PVT;
623: x_return_status := FND_API.G_RET_STS_ERROR;
624: -- Standard call to get message count and if count=1, get the message
625: FND_MSG_PUB.Count_And_Get (
619: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
620:
621: WHEN FND_API.G_EXC_ERROR THEN
622: ROLLBACK TO DELETE_Cnt_Point_PVT;
623: x_return_status := FND_API.G_RET_STS_ERROR;
624: -- Standard call to get message count and if count=1, get the message
625: FND_MSG_PUB.Count_And_Get (
626: p_encoded => FND_API.G_FALSE,
627: p_count => x_msg_count,
622: ROLLBACK TO DELETE_Cnt_Point_PVT;
623: x_return_status := FND_API.G_RET_STS_ERROR;
624: -- Standard call to get message count and if count=1, get the message
625: FND_MSG_PUB.Count_And_Get (
626: p_encoded => FND_API.G_FALSE,
627: p_count => x_msg_count,
628: p_data => x_msg_data
629: );
630:
627: p_count => x_msg_count,
628: p_data => x_msg_data
629: );
630:
631: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
632: ROLLBACK TO DELETE_Cnt_Point_PVT;
633: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
634: -- Standard call to get message count and if count=1, get the message
635: FND_MSG_PUB.Count_And_Get (
629: );
630:
631: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
632: ROLLBACK TO DELETE_Cnt_Point_PVT;
633: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
634: -- Standard call to get message count and if count=1, get the message
635: FND_MSG_PUB.Count_And_Get (
636: p_encoded => FND_API.G_FALSE,
637: p_count => x_msg_count,
632: ROLLBACK TO DELETE_Cnt_Point_PVT;
633: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
634: -- Standard call to get message count and if count=1, get the message
635: FND_MSG_PUB.Count_And_Get (
636: p_encoded => FND_API.G_FALSE,
637: p_count => x_msg_count,
638: p_data => x_msg_data
639: );
640:
639: );
640:
641: WHEN OTHERS THEN
642: ROLLBACK TO DELETE_Cnt_Point_PVT;
643: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
644: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
645: THEN
646: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
647: END IF;
646: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
647: END IF;
648: -- Standard call to get message count and if count=1, get the message
649: FND_MSG_PUB.Count_And_Get (
650: p_encoded => FND_API.G_FALSE,
651: p_count => x_msg_count,
652: p_data => x_msg_data
653: );
654: End Delete_Cnt_Point;
657:
658: -- Hint: Primary key needs to be returned.
659: PROCEDURE Lock_Cnt_Point(
660: p_api_version_number IN NUMBER,
661: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
662:
663: x_return_status OUT NOCOPY VARCHAR2,
664: x_msg_count OUT NOCOPY NUMBER,
665: x_msg_data OUT NOCOPY VARCHAR2,
696: AMS_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'start');
697: END IF;
698:
699: -- Initialize message list if p_init_msg_list is set to TRUE.
700: IF FND_API.to_Boolean( p_init_msg_list )
701: THEN
702: FND_MSG_PUB.initialize;
703: END IF;
704:
702: FND_MSG_PUB.initialize;
703: END IF;
704:
705: -- Standard call to check for call compatibility.
706: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
707: p_api_version_number,
708: l_api_name,
709: G_PKG_NAME)
710: THEN
707: p_api_version_number,
708: l_api_name,
709: G_PKG_NAME)
710: THEN
711: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
712: END IF;
713:
714:
715: -- Initialize API return status to SUCCESS
712: END IF;
713:
714:
715: -- Initialize API return status to SUCCESS
716: x_return_status := FND_API.G_RET_STS_SUCCESS;
717:
718:
719: ------------------------ lock -------------------------
720:
734: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
735: FND_MESSAGE.set_name('AMS', 'AMS_API_RECORD_NOT_FOUND');
736: FND_MSG_PUB.add;
737: END IF;
738: RAISE FND_API.g_exc_error;
739: END IF;
740:
741: CLOSE c_Cnt_Point;
742:
741: CLOSE c_Cnt_Point;
742:
743: -------------------- finish --------------------------
744: FND_MSG_PUB.count_and_get(
745: p_encoded => FND_API.g_false,
746: p_count => x_msg_count,
747: p_data => x_msg_data);
748: IF (AMS_DEBUG_HIGH_ON) THEN
749:
751: END IF;
752: EXCEPTION
753:
754: WHEN AMS_Utility_PVT.resource_locked THEN
755: x_return_status := FND_API.g_ret_sts_error;
756: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
757:
758: WHEN FND_API.G_EXC_ERROR THEN
759: ROLLBACK TO LOCK_Cnt_Point_PVT;
754: WHEN AMS_Utility_PVT.resource_locked THEN
755: x_return_status := FND_API.g_ret_sts_error;
756: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
757:
758: WHEN FND_API.G_EXC_ERROR THEN
759: ROLLBACK TO LOCK_Cnt_Point_PVT;
760: x_return_status := FND_API.G_RET_STS_ERROR;
761: -- Standard call to get message count and if count=1, get the message
762: FND_MSG_PUB.Count_And_Get (
756: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
757:
758: WHEN FND_API.G_EXC_ERROR THEN
759: ROLLBACK TO LOCK_Cnt_Point_PVT;
760: x_return_status := FND_API.G_RET_STS_ERROR;
761: -- Standard call to get message count and if count=1, get the message
762: FND_MSG_PUB.Count_And_Get (
763: p_encoded => FND_API.G_FALSE,
764: p_count => x_msg_count,
759: ROLLBACK TO LOCK_Cnt_Point_PVT;
760: x_return_status := FND_API.G_RET_STS_ERROR;
761: -- Standard call to get message count and if count=1, get the message
762: FND_MSG_PUB.Count_And_Get (
763: p_encoded => FND_API.G_FALSE,
764: p_count => x_msg_count,
765: p_data => x_msg_data
766: );
767:
764: p_count => x_msg_count,
765: p_data => x_msg_data
766: );
767:
768: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
769: ROLLBACK TO LOCK_Cnt_Point_PVT;
770: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
771: -- Standard call to get message count and if count=1, get the message
772: FND_MSG_PUB.Count_And_Get (
766: );
767:
768: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
769: ROLLBACK TO LOCK_Cnt_Point_PVT;
770: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
771: -- Standard call to get message count and if count=1, get the message
772: FND_MSG_PUB.Count_And_Get (
773: p_encoded => FND_API.G_FALSE,
774: p_count => x_msg_count,
769: ROLLBACK TO LOCK_Cnt_Point_PVT;
770: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
771: -- Standard call to get message count and if count=1, get the message
772: FND_MSG_PUB.Count_And_Get (
773: p_encoded => FND_API.G_FALSE,
774: p_count => x_msg_count,
775: p_data => x_msg_data
776: );
777:
776: );
777:
778: WHEN OTHERS THEN
779: ROLLBACK TO LOCK_Cnt_Point_PVT;
780: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
781: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
782: THEN
783: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
784: END IF;
783: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
784: END IF;
785: -- Standard call to get message count and if count=1, get the message
786: FND_MSG_PUB.Count_And_Get (
787: p_encoded => FND_API.G_FALSE,
788: p_count => x_msg_count,
789: p_data => x_msg_data
790: );
791: End Lock_Cnt_Point;
798: IS
799: l_valid_flag VARCHAR2(1);
800:
801: BEGIN
802: x_return_status := FND_API.g_ret_sts_success;
803: IF (AMS_DEBUG_HIGH_ON) THEN
804:
805: AMS_UTILITY_PVT.debug_message('Inside check_uk_items');
806: END IF;
812: l_valid_flag := AMS_Utility_PVT.check_uniqueness(
813: 'AMS_ACT_CONTACT_POINTS',
814: 'CONTACT_POINT_ID = ' || p_cnt_point_rec.CONTACT_POINT_ID
815: );
816: IF l_valid_flag = FND_API.g_false THEN
817: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CONTACT_POINT_ID_DUPLICATE');
818: x_return_status := FND_API.g_ret_sts_error;
819: RETURN;
820: END IF;
814: 'CONTACT_POINT_ID = ' || p_cnt_point_rec.CONTACT_POINT_ID
815: );
816: IF l_valid_flag = FND_API.g_false THEN
817: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CONTACT_POINT_ID_DUPLICATE');
818: x_return_status := FND_API.g_ret_sts_error;
819: RETURN;
820: END IF;
821: -- code added by me
822: /*l_valid_flag := AMS_Utility_PVT.check_uniqueness(
841:
842: -- ||
843: --''' AND CONTACT_POINT_ID <> ' || p_cnt_point_rec.CONTACT_POINT_ID
844: --);
845: IF l_valid_flag = FND_API.g_false THEN
846: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CONTACT_POINT_ID_DUPLICATE');
847: x_return_status := FND_API.g_ret_sts_error;
848: RETURN;
849: END IF;*/
843: --''' AND CONTACT_POINT_ID <> ' || p_cnt_point_rec.CONTACT_POINT_ID
844: --);
845: IF l_valid_flag = FND_API.g_false THEN
846: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CONTACT_POINT_ID_DUPLICATE');
847: x_return_status := FND_API.g_ret_sts_error;
848: RETURN;
849: END IF;*/
850:
851:
884: AMS_UTILITY_PVT.debug_message('Inside check_cnt_point_req_items');
885:
886: END IF;
887:
888: x_return_status := FND_API.g_ret_sts_success;
889:
890: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
891:
892: /*
889:
890: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
891:
892: /*
893: IF p_cnt_point_rec.contact_point_id = FND_API.g_miss_num OR p_cnt_point_rec.contact_point_id IS NULL THEN
894: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_ID');
895: x_return_status := FND_API.g_ret_sts_error;
896:
897: RETURN;
891:
892: /*
893: IF p_cnt_point_rec.contact_point_id = FND_API.g_miss_num OR p_cnt_point_rec.contact_point_id IS NULL THEN
894: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_ID');
895: x_return_status := FND_API.g_ret_sts_error;
896:
897: RETURN;
898: END IF;
899: */
897: RETURN;
898: END IF;
899: */
900:
901: /*IF p_cnt_point_rec.last_update_date = FND_API.g_miss_date OR p_cnt_point_rec.last_update_date IS NULL THEN
902: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_last_update_date');
903: x_return_status := FND_API.g_ret_sts_error;
904: RETURN;
905: END IF;
899: */
900:
901: /*IF p_cnt_point_rec.last_update_date = FND_API.g_miss_date OR p_cnt_point_rec.last_update_date IS NULL THEN
902: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_last_update_date');
903: x_return_status := FND_API.g_ret_sts_error;
904: RETURN;
905: END IF;
906:
907:
904: RETURN;
905: END IF;
906:
907:
908: IF p_cnt_point_rec.last_updated_by = FND_API.g_miss_num OR p_cnt_point_rec.last_updated_by IS NULL THEN
909: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_last_updated_by');
910: x_return_status := FND_API.g_ret_sts_error;
911: RETURN;
912: END IF;
906:
907:
908: IF p_cnt_point_rec.last_updated_by = FND_API.g_miss_num OR p_cnt_point_rec.last_updated_by IS NULL THEN
909: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_last_updated_by');
910: x_return_status := FND_API.g_ret_sts_error;
911: RETURN;
912: END IF;
913:
914:
911: RETURN;
912: END IF;
913:
914:
915: IF p_cnt_point_rec.creation_date = FND_API.g_miss_date OR p_cnt_point_rec.creation_date IS NULL THEN
916: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_creation_date');
917: x_return_status := FND_API.g_ret_sts_error;
918: RETURN;
919: END IF;
913:
914:
915: IF p_cnt_point_rec.creation_date = FND_API.g_miss_date OR p_cnt_point_rec.creation_date IS NULL THEN
916: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_creation_date');
917: x_return_status := FND_API.g_ret_sts_error;
918: RETURN;
919: END IF;
920:
921:
918: RETURN;
919: END IF;
920:
921:
922: IF p_cnt_point_rec.created_by = FND_API.g_miss_num OR p_cnt_point_rec.created_by IS NULL THEN
923: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_created_by');
924: x_return_status := FND_API.g_ret_sts_error;
925: RETURN;
926: END IF;
920:
921:
922: IF p_cnt_point_rec.created_by = FND_API.g_miss_num OR p_cnt_point_rec.created_by IS NULL THEN
923: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_created_by');
924: x_return_status := FND_API.g_ret_sts_error;
925: RETURN;
926: END IF;
927:
928:
925: RETURN;
926: END IF;
927:
928:
929: IF p_cnt_point_rec.object_version_number = FND_API.g_miss_num OR p_cnt_point_rec.object_version_number IS NULL THEN
930: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_object_version_number');
931: x_return_status := FND_API.g_ret_sts_error;
932: RETURN;
933: END IF; */
927:
928:
929: IF p_cnt_point_rec.object_version_number = FND_API.g_miss_num OR p_cnt_point_rec.object_version_number IS NULL THEN
930: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_object_version_number');
931: x_return_status := FND_API.g_ret_sts_error;
932: RETURN;
933: END IF; */
934:
935:
932: RETURN;
933: END IF; */
934:
935:
936: IF p_cnt_point_rec.arc_contact_used_by = FND_API.g_miss_char OR p_cnt_point_rec.arc_contact_used_by IS NULL THEN
937: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_USED_BY');
938: x_return_status := FND_API.g_ret_sts_error;
939: RETURN;
940: END IF;
934:
935:
936: IF p_cnt_point_rec.arc_contact_used_by = FND_API.g_miss_char OR p_cnt_point_rec.arc_contact_used_by IS NULL THEN
937: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_USED_BY');
938: x_return_status := FND_API.g_ret_sts_error;
939: RETURN;
940: END IF;
941:
942:
939: RETURN;
940: END IF;
941:
942:
943: IF p_cnt_point_rec.act_contact_used_by_id = FND_API.g_miss_num OR p_cnt_point_rec.act_contact_used_by_id IS NULL THEN
944: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_USED_BY_ID');
945: x_return_status := FND_API.g_ret_sts_error;
946: RETURN;
947: END IF;
941:
942:
943: IF p_cnt_point_rec.act_contact_used_by_id = FND_API.g_miss_num OR p_cnt_point_rec.act_contact_used_by_id IS NULL THEN
944: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_USED_BY_ID');
945: x_return_status := FND_API.g_ret_sts_error;
946: RETURN;
947: END IF;
948:
949:
946: RETURN;
947: END IF;
948:
949:
950: IF p_cnt_point_rec.contact_point_type = FND_API.g_miss_char OR p_cnt_point_rec.contact_point_type IS NULL THEN
951: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_TYPE');
952: x_return_status := FND_API.g_ret_sts_error;
953: RETURN;
954: END IF;
948:
949:
950: IF p_cnt_point_rec.contact_point_type = FND_API.g_miss_char OR p_cnt_point_rec.contact_point_type IS NULL THEN
951: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_TYPE');
952: x_return_status := FND_API.g_ret_sts_error;
953: RETURN;
954: END IF;
955:
956:
953: RETURN;
954: END IF;
955:
956:
957: IF p_cnt_point_rec.contact_point_value = FND_API.g_miss_char OR p_cnt_point_rec.contact_point_value IS NULL THEN
958: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_VALUE');
959: x_return_status := FND_API.g_ret_sts_error;
960: RETURN;
961: END IF;
955:
956:
957: IF p_cnt_point_rec.contact_point_value = FND_API.g_miss_char OR p_cnt_point_rec.contact_point_value IS NULL THEN
958: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_VALUE');
959: x_return_status := FND_API.g_ret_sts_error;
960: RETURN;
961: END IF;
962: ELSE
963:
963:
964:
965: IF p_cnt_point_rec.contact_point_id IS NULL THEN
966: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_ID');
967: x_return_status := FND_API.g_ret_sts_error;
968: RETURN;
969: END IF;
970:
971:
970:
971:
972: /*IF p_cnt_point_rec.last_update_date IS NULL THEN
973: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_last_update_date');
974: x_return_status := FND_API.g_ret_sts_error;
975: RETURN;
976: END IF;
977:
978:
977:
978:
979: IF p_cnt_point_rec.last_updated_by IS NULL THEN
980: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_last_updated_by');
981: x_return_status := FND_API.g_ret_sts_error;
982: RETURN;
983: END IF;
984:
985:
984:
985:
986: IF p_cnt_point_rec.creation_date IS NULL THEN
987: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_creation_date');
988: x_return_status := FND_API.g_ret_sts_error;
989: RETURN;
990: END IF;
991:
992:
991:
992:
993: IF p_cnt_point_rec.created_by IS NULL THEN
994: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_created_by');
995: x_return_status := FND_API.g_ret_sts_error;
996: RETURN;
997: END IF;
998:
999:
998:
999:
1000: IF p_cnt_point_rec.object_version_number IS NULL THEN
1001: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_cnt_point_NO_object_version_number');
1002: x_return_status := FND_API.g_ret_sts_error;
1003: RETURN;
1004: END IF; */
1005:
1006:
1005:
1006:
1007: IF p_cnt_point_rec.arc_contact_used_by IS NULL THEN
1008: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_USED_BY');
1009: x_return_status := FND_API.g_ret_sts_error;
1010: RETURN;
1011: END IF;
1012:
1013:
1012:
1013:
1014: IF p_cnt_point_rec.act_contact_used_by_id IS NULL THEN
1015: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_USED_BY_ID');
1016: x_return_status := FND_API.g_ret_sts_error;
1017: RETURN;
1018: END IF;
1019:
1020:
1019:
1020:
1021: IF p_cnt_point_rec.contact_point_type IS NULL THEN
1022: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_TYPE');
1023: x_return_status := FND_API.g_ret_sts_error;
1024: RETURN;
1025: END IF;
1026:
1027:
1026:
1027:
1028: IF p_cnt_point_rec.contact_point_value IS NULL THEN
1029: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_NO_VALUE');
1030: x_return_status := FND_API.g_ret_sts_error;
1031: RETURN;
1032: END IF;
1033: END IF;
1034:
1058:
1059: AMS_UTILITY_PVT.debug_message('Inside check_country_exists');
1060: END IF;
1061: -- initialise the return status to success
1062: x_return_status := FND_API.g_ret_sts_success ;
1063:
1064: -- if country is null or missing then perform the check
1065: IF p_cnt_point_rec.country <> FND_API.g_miss_num
1066: AND p_cnt_point_rec.country IS NOT NULL THEN
1061: -- initialise the return status to success
1062: x_return_status := FND_API.g_ret_sts_success ;
1063:
1064: -- if country is null or missing then perform the check
1065: IF p_cnt_point_rec.country <> FND_API.g_miss_num
1066: AND p_cnt_point_rec.country IS NOT NULL THEN
1067: IF
1068: AMS_Utility_PVT.check_fk_exists(
1069: p_table_name => l_table_name
1070: , p_pk_name => l_pk_name
1071: , p_pk_value => l_pk_value
1072: , p_pk_data_type => l_pk_data_type
1073: , p_additional_where_clause => NULL
1074: ) = FND_API.g_false
1075: THEN
1076: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_BAD_COUNTRY');
1077: x_return_status := FND_API.g_ret_sts_error;
1078: RETURN ;
1073: , p_additional_where_clause => NULL
1074: ) = FND_API.g_false
1075: THEN
1076: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CNT_POINT_BAD_COUNTRY');
1077: x_return_status := FND_API.g_ret_sts_error;
1078: RETURN ;
1079: END IF;
1080: END IF;
1081:
1089: BEGIN
1090: --
1091: -- Initialize the OUT parameter
1092: --
1093: x_return_status := FND_API.g_ret_sts_success ;
1094: -- code added by me
1095: -- Check arc_contact_used_by
1096: IF (AMS_DEBUG_HIGH_ON) THEN
1097:
1097:
1098: AMS_UTILITY_PVT.debug_message('Inside check_cnt_point_fk_items');
1099: END IF;
1100:
1101: IF p_cnt_point_rec.arc_contact_used_by <> FND_API.G_MISS_CHAR THEN
1102: IF p_cnt_point_rec.arc_contact_used_by <> 'CAMP' AND
1103: p_cnt_point_rec.arc_contact_used_by <> 'CSCH' AND
1104: p_cnt_point_rec.arc_contact_used_by <> 'EVEH' AND
1105: p_cnt_point_rec.arc_contact_used_by <> 'EVEO'
1113: FND_MSG_PUB.Add;
1114: END IF;*/
1115:
1116:
1117: x_return_status := FND_API.G_RET_STS_ERROR;
1118: -- If any errors happen abort API/Procedure.
1119: RETURN;
1120: END IF;
1121: END IF;
1119: RETURN;
1120: END IF;
1121: END IF;
1122:
1123: IF p_cnt_point_rec.country <> FND_API.G_MISS_NUM AND p_cnt_point_rec.country IS NOT NULL THEN
1124: check_country_exists(
1125: p_cnt_point_rec => p_cnt_point_rec
1126: , x_return_status => x_return_status
1127: );
1125: p_cnt_point_rec => p_cnt_point_rec
1126: , x_return_status => x_return_status
1127: );
1128:
1129: IF x_return_status <> FND_API.g_ret_sts_success THEN
1130: AMS_Utility_PVT.Error_Message(p_message_name => 'API_CONTACT_INVALID_COUNTRY');
1131: RETURN;
1132: END IF;
1133: END IF;
1154: IF (AMS_DEBUG_HIGH_ON) THEN
1155:
1156: AMS_UTILITY_PVT.debug_message(p_cnt_point_rec.arc_contact_used_by);
1157: END IF;
1158: x_return_status := FND_API.g_ret_sts_success;
1159: -- code added by me
1160: IF p_cnt_point_rec.CONTACT_POINT_TYPE <> FND_API.G_MISS_CHAR
1161: THEN
1162: IF (AMS_DEBUG_HIGH_ON) THEN
1156: AMS_UTILITY_PVT.debug_message(p_cnt_point_rec.arc_contact_used_by);
1157: END IF;
1158: x_return_status := FND_API.g_ret_sts_success;
1159: -- code added by me
1160: IF p_cnt_point_rec.CONTACT_POINT_TYPE <> FND_API.G_MISS_CHAR
1161: THEN
1162: IF (AMS_DEBUG_HIGH_ON) THEN
1163:
1164: AMS_UTILITY_PVT.debug_message(' LookUp type lookup code = '''|| p_cnt_point_rec.contact_point_value);
1166: IF AMS_Utility_PVT.Check_Lookup_Exists
1167: ( p_lookup_table_name => 'AMS_LOOKUPS'
1168: ,p_lookup_type => 'AMS_CONTACT_POINT_TYPE'
1169: ,p_lookup_code => p_cnt_point_rec.contact_point_type
1170: ) = FND_API.G_FALSE then
1171:
1172: -- invalid item
1173: /* IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR)
1174: THEN -- MMSG
1176:
1177: FND_MSG_PUB.Add;
1178: END IF;*/
1179: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CONTACT_INVALID_TYPE');
1180: x_return_status := FND_API.G_RET_STS_ERROR;
1181: -- If any errors happen abort API/Procedure.
1182: RETURN;
1183: END IF;
1184: END IF;
1214: check_cnt_point_uk_items(
1215: p_cnt_point_rec => p_cnt_point_rec,
1216: p_validation_mode => p_validation_mode,
1217: x_return_status => x_return_status);
1218: IF x_return_status <> FND_API.g_ret_sts_success THEN
1219: RETURN;
1220: END IF;
1221: IF (AMS_DEBUG_HIGH_ON) THEN
1222:
1235: check_cnt_point_req_items(
1236: p_cnt_point_rec => p_cnt_point_rec,
1237: p_validation_mode => p_validation_mode,
1238: x_return_status => x_return_status);
1239: IF x_return_status <> FND_API.g_ret_sts_success THEN
1240: RETURN;
1241: END IF;
1242: IF (AMS_DEBUG_HIGH_ON) THEN
1243:
1254: END IF;
1255: check_cnt_point_FK_items(
1256: p_cnt_point_rec => p_cnt_point_rec,
1257: x_return_status => x_return_status);
1258: IF x_return_status <> FND_API.g_ret_sts_success THEN
1259: RETURN;
1260: END IF;
1261: IF (AMS_DEBUG_HIGH_ON) THEN
1262:
1272: END IF;
1273: check_cnt_point_Lookup_items(
1274: p_cnt_point_rec => p_cnt_point_rec,
1275: x_return_status => x_return_status);
1276: IF x_return_status <> FND_API.g_ret_sts_success THEN
1277: RETURN;
1278: END IF;
1279: IF (AMS_DEBUG_HIGH_ON) THEN
1280:
1299:
1300:
1301: PROCEDURE Validate_cnt_point(
1302: p_api_version_number IN NUMBER,
1303: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1304: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1305: p_validation_mode IN VARCHAR2,
1306: p_cnt_point_rec IN cnt_point_rec_type,
1307: x_return_status OUT NOCOPY VARCHAR2,
1300:
1301: PROCEDURE Validate_cnt_point(
1302: p_api_version_number IN NUMBER,
1303: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1304: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1305: p_validation_mode IN VARCHAR2,
1306: p_cnt_point_rec IN cnt_point_rec_type,
1307: x_return_status OUT NOCOPY VARCHAR2,
1308: x_msg_count OUT NOCOPY NUMBER,
1324: -- Standard Start of API savepoint
1325: SAVEPOINT VALIDATE_Cnt_Point_;
1326:
1327: -- Standard call to check for call compatibility.
1328: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
1329: p_api_version_number,
1330: l_api_name,
1331: G_PKG_NAME)
1332: THEN
1329: p_api_version_number,
1330: l_api_name,
1331: G_PKG_NAME)
1332: THEN
1333: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1334: END IF;
1335:
1336: IF (AMS_DEBUG_HIGH_ON) THEN
1337:
1340: AMS_UTILITY_PVT.debug_message('Validate Api is compatible');
1341:
1342: END IF;
1343: -- Initialize message list if p_init_msg_list is set to TRUE.
1344: IF FND_API.to_Boolean( p_init_msg_list )
1345: THEN
1346: FND_MSG_PUB.initialize;
1347: END IF;
1348:
1368: AMS_UTILITY_PVT.debug_message('DOne calling check_cnt_point '||p_cnt_point_rec.arc_contact_used_by|| x_return_status);
1369:
1370: END IF;
1371:
1372: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1373: RAISE FND_API.G_EXC_ERROR;
1374: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1375: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1376: END IF;
1369:
1370: END IF;
1371:
1372: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1373: RAISE FND_API.G_EXC_ERROR;
1374: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1375: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1376: END IF;
1377: END IF;
1370: END IF;
1371:
1372: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1373: RAISE FND_API.G_EXC_ERROR;
1374: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1375: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1376: END IF;
1377: END IF;
1378:
1371:
1372: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1373: RAISE FND_API.G_EXC_ERROR;
1374: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1375: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1376: END IF;
1377: END IF;
1378:
1379: IF (AMS_DEBUG_HIGH_ON) THEN
1405: END IF;
1406: Validate_cnt_point_Rec(
1407: p_api_version_number => 1.0,
1408: p_validation_mode => p_validation_mode,
1409: p_init_msg_list => FND_API.G_FALSE,
1410:
1411: x_return_status => x_return_status,
1412: x_msg_count => x_msg_count,
1413: x_msg_data => x_msg_data,
1416:
1417: AMS_UTILITY_PVT.debug_message('DOne calling Validate rec ' ||p_cnt_point_rec.arc_contact_used_by|| x_return_status);
1418: END IF;
1419:
1420: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1421: RAISE FND_API.G_EXC_ERROR;
1422: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1423: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1424: END IF;
1417: AMS_UTILITY_PVT.debug_message('DOne calling Validate rec ' ||p_cnt_point_rec.arc_contact_used_by|| x_return_status);
1418: END IF;
1419:
1420: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1421: RAISE FND_API.G_EXC_ERROR;
1422: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1423: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1424: END IF;
1425: END IF;
1418: END IF;
1419:
1420: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1421: RAISE FND_API.G_EXC_ERROR;
1422: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1423: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1424: END IF;
1425: END IF;
1426:
1419:
1420: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1421: RAISE FND_API.G_EXC_ERROR;
1422: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1423: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1424: END IF;
1425: END IF;
1426:
1427:
1432: END IF;
1433:
1434:
1435: -- Initialize API return status to SUCCESS
1436: x_return_status := FND_API.G_RET_STS_SUCCESS;
1437:
1438:
1439: -- Debug Message
1440: IF (AMS_DEBUG_HIGH_ON) THEN
1443: END IF;
1444:
1445: -- Standard call to get message count and if count is 1, get message info.
1446: FND_MSG_PUB.Count_And_Get
1447: (p_encoded => FND_API.G_FALSE,
1448: p_count => x_msg_count,
1449: p_data => x_msg_data
1450: );
1451: EXCEPTION
1450: );
1451: EXCEPTION
1452:
1453: WHEN AMS_Utility_PVT.resource_locked THEN
1454: x_return_status := FND_API.g_ret_sts_error;
1455: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
1456:
1457: WHEN FND_API.G_EXC_ERROR THEN
1458: ROLLBACK TO VALIDATE_Cnt_Point_;
1453: WHEN AMS_Utility_PVT.resource_locked THEN
1454: x_return_status := FND_API.g_ret_sts_error;
1455: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
1456:
1457: WHEN FND_API.G_EXC_ERROR THEN
1458: ROLLBACK TO VALIDATE_Cnt_Point_;
1459: x_return_status := FND_API.G_RET_STS_ERROR;
1460: -- Standard call to get message count and if count=1, get the message
1461: FND_MSG_PUB.Count_And_Get (
1455: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_API_RESOURCE_LOCKED');
1456:
1457: WHEN FND_API.G_EXC_ERROR THEN
1458: ROLLBACK TO VALIDATE_Cnt_Point_;
1459: x_return_status := FND_API.G_RET_STS_ERROR;
1460: -- Standard call to get message count and if count=1, get the message
1461: FND_MSG_PUB.Count_And_Get (
1462: p_encoded => FND_API.G_FALSE,
1463: p_count => x_msg_count,
1458: ROLLBACK TO VALIDATE_Cnt_Point_;
1459: x_return_status := FND_API.G_RET_STS_ERROR;
1460: -- Standard call to get message count and if count=1, get the message
1461: FND_MSG_PUB.Count_And_Get (
1462: p_encoded => FND_API.G_FALSE,
1463: p_count => x_msg_count,
1464: p_data => x_msg_data
1465: );
1466:
1463: p_count => x_msg_count,
1464: p_data => x_msg_data
1465: );
1466:
1467: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1468: ROLLBACK TO VALIDATE_Cnt_Point_;
1469: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1470: -- Standard call to get message count and if count=1, get the message
1471: FND_MSG_PUB.Count_And_Get (
1465: );
1466:
1467: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1468: ROLLBACK TO VALIDATE_Cnt_Point_;
1469: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1470: -- Standard call to get message count and if count=1, get the message
1471: FND_MSG_PUB.Count_And_Get (
1472: p_encoded => FND_API.G_FALSE,
1473: p_count => x_msg_count,
1468: ROLLBACK TO VALIDATE_Cnt_Point_;
1469: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1470: -- Standard call to get message count and if count=1, get the message
1471: FND_MSG_PUB.Count_And_Get (
1472: p_encoded => FND_API.G_FALSE,
1473: p_count => x_msg_count,
1474: p_data => x_msg_data
1475: );
1476:
1475: );
1476:
1477: WHEN OTHERS THEN
1478: ROLLBACK TO VALIDATE_Cnt_Point_;
1479: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1480: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1481: THEN
1482: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1483: END IF;
1482: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1483: END IF;
1484: -- Standard call to get message count and if count=1, get the message
1485: FND_MSG_PUB.Count_And_Get (
1486: p_encoded => FND_API.G_FALSE,
1487: p_count => x_msg_count,
1488: p_data => x_msg_data
1489: );
1490: End Validate_Cnt_Point;
1518:
1519: BEGIN
1520:
1521: -- Initialize API return status to SUCCESS
1522: x_return_status := FND_API.G_RET_STS_SUCCESS;
1523:
1524: IF(p_validation_mode = JTF_PLSQL_API.g_create)
1525: THEN
1526: OPEN c_check_cnt_point_uk_rec_cr ;
1525: THEN
1526: OPEN c_check_cnt_point_uk_rec_cr ;
1527: FETCH c_check_cnt_point_uk_rec_cr INTO l_contact_point_id;
1528: IF c_check_cnt_point_uk_rec_cr%FOUND THEN
1529: x_return_status := FND_API.G_RET_STS_ERROR;
1530: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CONTACT_POINT_ID_DUPLICATE');
1531: CLOSE c_check_cnt_point_uk_rec_cr ;
1532: RETURN;
1533: END IF;
1538: OPEN c_check_cnt_point_uk_rec_up ;
1539: FETCH c_check_cnt_point_uk_rec_up INTO l_contact_point_id;
1540:
1541: IF c_check_cnt_point_uk_rec_up%FOUND THEN
1542: x_return_status := FND_API.G_RET_STS_ERROR;
1543: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CONTACT_POINT_ID_DUPLICATE');
1544: CLOSE c_check_cnt_point_uk_rec_up ;
1545: RETURN;
1546: END IF;
1611: ,p_pk_name => l_pk_name
1612: ,p_pk_value => l_pk_value
1613: --,p_pk_data_type => l_pk_data_type
1614: --,p_additional_where_clause => l_additional_where_clause
1615: ) = FND_API.G_FALSE
1616: THEN
1617:
1618: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_TRIG_INVALID_CREATED_FOR');
1619:
1617:
1618: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_TRIG_INVALID_CREATED_FOR');
1619:
1620:
1621: x_return_status := FND_API.G_RET_STS_ERROR;
1622: IF (AMS_DEBUG_HIGH_ON) THEN
1623:
1624: AMS_UTILITY_PVT.debug_message(' Done Calling Check FK Exists '|| l_table_name || l_pk_name || l_pk_value || l_pk_data_type || x_return_status );
1625: END IF;
1638: IF AMS_Utility_PVT.Check_FK_Exists (
1639: p_table_name => 'ies_deployed_scripts'
1640: ,p_pk_name => 'ltrim(rtrim(dscript_name))'
1641: ,p_pk_value => ltrim(rtrim(l_contact_point_value))
1642: ) = FND_API.G_FALSE
1643: THEN
1644: IF l_contact_point_type = 'INBOUND_SCRIPT'
1645: THEN
1646: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CSCH_BAD_INBOUND_DSCRIPT');
1648: THEN
1649: AMS_Utility_PVT.Error_Message(p_message_name => 'AMS_CSCH_BAD_OUTBOUND_DSCRIPT');
1650: END IF;
1651:
1652: x_return_status := FND_API.G_RET_STS_ERROR;
1653: IF (AMS_DEBUG_HIGH_ON) THEN
1654:
1655: AMS_UTILITY_PVT.debug_message(' Done Calling Check FK Exists '|| l_table_name || l_pk_name || l_pk_value || l_pk_data_type || x_return_status );
1656: END IF;
1668:
1669: PROCEDURE Validate_cnt_point_rec(
1670: p_api_version_number IN NUMBER,
1671: p_validation_mode IN VARCHAR2,
1672: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1673: x_return_status OUT NOCOPY VARCHAR2,
1674: x_msg_count OUT NOCOPY NUMBER,
1675: x_msg_data OUT NOCOPY VARCHAR2,
1676: p_cnt_point_rec IN cnt_point_rec_type
1683: l_pk_data_type NUMBER;
1684: l_additional_where_clause VARCHAR2(100);
1685: BEGIN
1686: -- Initialize message list if p_init_msg_list is set to TRUE.
1687: IF FND_API.to_Boolean( p_init_msg_list )
1688: THEN
1689: FND_MSG_PUB.initialize;
1690: END IF;
1691:
1696: AMS_UTILITY_PVT.debug_message('Inside Validate rec'||p_cnt_point_rec.arc_contact_used_by|| x_return_status);
1697:
1698: END IF;
1699: -- Initialize API return status to SUCCESS
1700: x_return_status := FND_API.G_RET_STS_SUCCESS;
1701:
1702: -- Hint: Validate data
1703: -- If data not valid
1704: -- THEN
1701:
1702: -- Hint: Validate data
1703: -- If data not valid
1704: -- THEN
1705: -- x_return_status := FND_API.G_RET_STS_ERROR;
1706: -- code added by rssharma
1707: /* check_cnt_point_FK_items(
1708: p_cnt_point_rec => p_cnt_point_rec,
1709: x_return_status => x_return_status
1708: p_cnt_point_rec => p_cnt_point_rec,
1709: x_return_status => x_return_status
1710: );
1711:
1712: IF x_return_status <> FND_API.g_ret_sts_success THEN
1713: RETURN;
1714: END IF;*/
1715: IF (AMS_DEBUG_HIGH_ON) THEN
1716:
1724: IF (AMS_DEBUG_HIGH_ON) THEN
1725:
1726: AMS_UTILITY_PVT.debug_message(' Done calling check_cnt_point_fk_rec '||p_cnt_point_rec.arc_contact_used_by|| x_return_status);
1727: END IF;
1728: IF x_return_status <> FND_API.g_ret_sts_success THEN
1729: RETURN;
1730: END IF;
1731:
1732:
1748:
1749: AMS_UTILITY_PVT.debug_message(' Done calling check_cnt_point_uk_rec '||x_return_status);
1750: END IF;
1751:
1752: IF x_return_status <> FND_API.g_ret_sts_success THEN
1753: RETURN;
1754: END IF;
1755: -- end code added by me
1756: