56: l_msg_index_out NUMBER := 0;
57: j NUMBER;
58: BEGIN
59: x_msg_data := NULL;
60: l_count := FND_MSG_PUB.Count_Msg;
61: IF l_count > 0 THEN
62: FND_MSG_PUB.Get(p_msg_index => l_count,
63: p_encoded => FND_API.G_FALSE,
64: p_data => x_msg_data,
58: BEGIN
59: x_msg_data := NULL;
60: l_count := FND_MSG_PUB.Count_Msg;
61: IF l_count > 0 THEN
62: FND_MSG_PUB.Get(p_msg_index => l_count,
63: p_encoded => FND_API.G_FALSE,
64: p_data => x_msg_data,
65: p_msg_index_out => l_msg_index_out);
66: END IF;
131: --------------------------------------------------------
132: IF p_template_group_id IS NULL THEN
133: l_error_msg:='Template group id must not be null';
134: fnd_message.set_name('AS','AS_INVALID_TEMPLATE_ID');
135: fnd_msg_pub.add;
136: RAISE fnd_api.g_exc_unexpected_error;
137: END IF;
138: IF p_owner_id IS NULL THEN
139: l_error_msg:='Owner id must not be null';
137: END IF;
138: IF p_owner_id IS NULL THEN
139: l_error_msg:='Owner id must not be null';
140: fnd_message.set_name('AS','AS_INVALID_OWNER_ID');
141: fnd_msg_pub.add;
142: RAISE fnd_api.g_exc_unexpected_error;
143: END IF;
144: /*IF p_owner_type_code IS NULL THEN
145: l_error_msg:='Owner Type Code must not be null';
142: RAISE fnd_api.g_exc_unexpected_error;
143: END IF;
144: /*IF p_owner_type_code IS NULL THEN
145: l_error_msg:='Owner Type Code must not be null';
146: fnd_msg_pub.add_exc_msg('AS_SALES_METH','START_METHODOLOGY',l_error_msg);
147: fnd_msg_pub.add;
148: RAISE fnd_api.g_exc_unexpected_error;
149: END IF;*/
150: IF p_source_object_id IS NULL THEN
143: END IF;
144: /*IF p_owner_type_code IS NULL THEN
145: l_error_msg:='Owner Type Code must not be null';
146: fnd_msg_pub.add_exc_msg('AS_SALES_METH','START_METHODOLOGY',l_error_msg);
147: fnd_msg_pub.add;
148: RAISE fnd_api.g_exc_unexpected_error;
149: END IF;*/
150: IF p_source_object_id IS NULL THEN
151: l_error_msg:='Source Object id must not be null';
149: END IF;*/
150: IF p_source_object_id IS NULL THEN
151: l_error_msg:='Source Object id must not be null';
152: fnd_message.set_name('AS','AS_INVALID_OBJECT_ID');
153: fnd_msg_pub.add;
154: RAISE fnd_api.g_exc_unexpected_error;
155: END IF;
156: IF p_source_object_type_code IS NULL THEN
157: l_error_msg:='Source object type code must not be null';
156: IF p_source_object_type_code IS NULL THEN
157: l_error_msg:='Source object type code must not be null';
158: PRINT_MESSAGE('p_error_msg = ' || l_error_msg);
159: fnd_message.set_name('AS','AS_INVALID_OBJECT_TYPE');
160: fnd_msg_pub.add;
161: RAISE fnd_api.g_exc_unexpected_error;
162: END IF;
163: IF p_source_object_name IS NULL THEN
164: l_error_msg:='Source object name must not be null';
163: IF p_source_object_name IS NULL THEN
164: l_error_msg:='Source object name must not be null';
165: PRINT_MESSAGE('p_error_msg = ' || l_error_msg);
166: fnd_message.set_name('AS','AS_INVALID_OBJECT_NAME');
167: fnd_msg_pub.add;
168: RAISE fnd_api.g_exc_unexpected_error;
169: END IF;
170: /*IF p_current_stage_id IS NULL THEN
171: l_error_msg:='Current Stage id must not be null';
169: END IF;
170: /*IF p_current_stage_id IS NULL THEN
171: l_error_msg:='Current Stage id must not be null';
172: print_message('p_error_msg = ' || l_error_msg);
173: fnd_msg_pub.add_exc_msg('AS_SALES_METH','START_METHODOLOGY',l_error_msg);
174: fnd_msg_pub.add;
175: RAISE fnd_api.g_exc_unexpected_error;
176: END IF;*/
177: IF p_next_stage_id IS NULL THEN
170: /*IF p_current_stage_id IS NULL THEN
171: l_error_msg:='Current Stage id must not be null';
172: print_message('p_error_msg = ' || l_error_msg);
173: fnd_msg_pub.add_exc_msg('AS_SALES_METH','START_METHODOLOGY',l_error_msg);
174: fnd_msg_pub.add;
175: RAISE fnd_api.g_exc_unexpected_error;
176: END IF;*/
177: IF p_next_stage_id IS NULL THEN
178: l_error_msg:='Next Stage id must not be null';
177: IF p_next_stage_id IS NULL THEN
178: l_error_msg:='Next Stage id must not be null';
179: print_message('p_error_msg = ' || l_error_msg);
180: fnd_message.set_name('AS','AS_INVALID_NEXT_STAGE');
181: fnd_msg_pub.add;
182: RAISE fnd_api.g_exc_unexpected_error;
183: END IF;
184: ----------------------------------------------------------
185: OPEN c_profile;
188: CLOSE c_profile;
189: l_error_msg:='Required Profile not found';
190: PRINT_MESSAGE('p_error_msg = ' || l_error_msg);
191: fnd_message.set_name('AS','AS_PROFILE_NOT_FOUND');
192: fnd_msg_pub.add;
193: RAISE fnd_api.g_exc_unexpected_error;
194: END IF;
195: CLOSE c_profile;
196: IF l_profile_value = 'Y' THEN
202: CLOSE c_resource;
203: l_error_msg := 'Category for resource not found in jtf_rs_resource_extns table';
204: PRINT_MESSAGE('p_error_msg = ' || l_error_msg);
205: fnd_message.set_name('AS','AS_INVALID_RESOURCE');
206: fnd_msg_pub.add;
207: RAISE fnd_api.g_exc_unexpected_error;
208: END IF;
209: CLOSE c_resource;
210: -------------------------------
321: CLOSE c_meth;
322: ELSE
323: l_error_msg:='Item Type OR Item Key IS not null';
324: fnd_message.set_name('AS','AS_INVALID_ITEMTYPE');
325: fnd_msg_pub.add;
326: RAISE fnd_api.g_exc_unexpected_error;
327: x_return_status := 'U';
328: END IF;
329: ---------------------------------------------------------------
330: ELSE
331: l_error_msg:='Invalid Profile value';
332: PRINT_MESSAGE('p_error_msg = ' || l_error_msg);
333: fnd_message.set_name('AS','AS_INVALID_PROFILE');
334: fnd_msg_pub.add;
335: RAISE fnd_api.g_exc_unexpected_error;
336: x_return_status := 'U';
337: END IF;
338: x_warning_message := wf_engine.getitemattrtext( itemtype => itemtype,
346: --ROLLBACK TO Start_Request;
347: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
348: Add_Error_Message (l_api_name, l_Error_Msg);
349: -- Standard call to get message count and if count=1, get the message
350: FND_MSG_PUB.count_and_get(
351: p_encoded => FND_API.g_false,
352: p_count => x_msg_count,
353: p_data => x_msg_data
354: );
357: --ROLLBACK TO Start_Request;
358: x_return_status := FND_API.G_RET_STS_ERROR;
359: Add_Error_Message (l_api_name, l_Error_Msg);
360: -- Standard call to get message count and if count=1, get the message
361: FND_MSG_PUB.count_and_get(
362: p_encoded => FND_API.g_false,
363: p_count => x_msg_count,
364: p_data => x_msg_data
365: );
367: WHEN OTHERS THEN
368: --ROLLBACK TO Start_Request;
369: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
370: Add_Error_Message (l_api_name, SQLERRM);
371: IF FND_MSG_PUB.Check_Msg_Level
372: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
373: THEN
374: FND_MSG_PUB.Add_Exc_Msg
375: (G_PKG_NAME, l_api_name,sqlerrm);
368: --ROLLBACK TO Start_Request;
369: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
370: Add_Error_Message (l_api_name, SQLERRM);
371: IF FND_MSG_PUB.Check_Msg_Level
372: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
373: THEN
374: FND_MSG_PUB.Add_Exc_Msg
375: (G_PKG_NAME, l_api_name,sqlerrm);
376: END IF;
370: Add_Error_Message (l_api_name, SQLERRM);
371: IF FND_MSG_PUB.Check_Msg_Level
372: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
373: THEN
374: FND_MSG_PUB.Add_Exc_Msg
375: (G_PKG_NAME, l_api_name,sqlerrm);
376: END IF;
377: -- Standard call to get message count and if count=1, get the message
378: FND_MSG_PUB.count_and_get(
374: FND_MSG_PUB.Add_Exc_Msg
375: (G_PKG_NAME, l_api_name,sqlerrm);
376: END IF;
377: -- Standard call to get message count and if count=1, get the message
378: FND_MSG_PUB.count_and_get(
379: p_encoded => FND_API.g_false,
380: p_count => x_msg_count,
381: p_data => x_msg_data
382: );
669:
670: IF l_source_object_id IS NULL THEN
671: l_error_msg:='Source Object id must not be null';
672: fnd_message.set_name('AS','AS_INVALID_OBJECT_ID');
673: fnd_msg_pub.add;
674: RAISE fnd_api.g_exc_unexpected_error;
675: END IF;
676:
677: OPEN c_customer_info(l_source_object_id);
795: X_MSG_COUNT => l_msg_count,
796: X_MSG_DATA => l_msg_data );
797: ---------------------------------------------------
798: print_message('Return status= '||l_ref_status);
799: IF (FND_MSG_PUB.count_msg >0) THEN
800: FOR j IN 1..FND_MSG_PUB.Count_msg
801: LOOP
802: fnd_msg_pub.get ( p_msg_index => j,
803: p_encoded => 'F',
796: X_MSG_DATA => l_msg_data );
797: ---------------------------------------------------
798: print_message('Return status= '||l_ref_status);
799: IF (FND_MSG_PUB.count_msg >0) THEN
800: FOR j IN 1..FND_MSG_PUB.Count_msg
801: LOOP
802: fnd_msg_pub.get ( p_msg_index => j,
803: p_encoded => 'F',
804: p_data => l_msg_data,
798: print_message('Return status= '||l_ref_status);
799: IF (FND_MSG_PUB.count_msg >0) THEN
800: FOR j IN 1..FND_MSG_PUB.Count_msg
801: LOOP
802: fnd_msg_pub.get ( p_msg_index => j,
803: p_encoded => 'F',
804: p_data => l_msg_data,
805: p_msg_index_out => l_msg_index_out);
806: print_message(l_msg_data);
823: ---------------------------------------------------
824: ELSE
825: l_return_status := 'U';
826: ROLLBACK TO AS_CREATE_TASK;
827: IF (FND_MSG_PUB.count_msg >0) THEN
828: FOR j IN 1..FND_MSG_PUB.Count_msg
829: LOOP
830: fnd_msg_pub.get ( p_msg_index => j,
831: p_encoded => 'F',
824: ELSE
825: l_return_status := 'U';
826: ROLLBACK TO AS_CREATE_TASK;
827: IF (FND_MSG_PUB.count_msg >0) THEN
828: FOR j IN 1..FND_MSG_PUB.Count_msg
829: LOOP
830: fnd_msg_pub.get ( p_msg_index => j,
831: p_encoded => 'F',
832: p_data => l_msg_data,
826: ROLLBACK TO AS_CREATE_TASK;
827: IF (FND_MSG_PUB.count_msg >0) THEN
828: FOR j IN 1..FND_MSG_PUB.Count_msg
829: LOOP
830: fnd_msg_pub.get ( p_msg_index => j,
831: p_encoded => 'F',
832: p_data => l_msg_data,
833: p_msg_index_out => l_msg_index_out);
834: print_message(l_msg_data);
856: EXCEPTION
857: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
858: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
859: Add_Error_Message (l_api_name, l_Error_Msg);
860: FND_MSG_PUB.count_and_get( p_encoded => FND_API.g_false,
861: p_count => l_msg_count,
862: p_data => l_msg_data );
863: Get_Error_Message(l_msg_data);
864: WHEN OTHERS THEN