744: SAVEPOINT create_supp_user_account_sp;
745:
746: IF p_user_name IS NULL THEN
747: x_return_status := fnd_api.g_ret_sts_error;
748: fnd_message.set_name('POS', 'POS_CRSUSER_USERNAME_NULL');
749: fnd_msg_pub.ADD;
750: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
751: RETURN;
752: END IF;
755: FETCH l_fnd_user_cur INTO l_fnd_user_rec;
756: IF l_fnd_user_cur%found THEN
757: CLOSE l_fnd_user_cur;
758: x_return_status := fnd_api.g_ret_sts_error;
759: fnd_message.set_name('POS', 'POS_CRSUSER_USERNAME_EXISTS');
760: fnd_message.set_token('USER_NAME', p_user_name);
761: fnd_msg_pub.ADD;
762: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
763: RETURN;
756: IF l_fnd_user_cur%found THEN
757: CLOSE l_fnd_user_cur;
758: x_return_status := fnd_api.g_ret_sts_error;
759: fnd_message.set_name('POS', 'POS_CRSUSER_USERNAME_EXISTS');
760: fnd_message.set_token('USER_NAME', p_user_name);
761: fnd_msg_pub.ADD;
762: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
763: RETURN;
764: END IF;
765: CLOSE l_fnd_user_cur;
766:
767: IF p_user_email IS NULL THEN
768: x_return_status := fnd_api.g_ret_sts_error;
769: fnd_message.set_name('POS', 'POS_CRSUSER_EMAIL_NULL');
770: fnd_msg_pub.ADD;
771: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
772: RETURN;
773: END IF;
773: END IF;
774:
775: IF p_person_party_id IS NULL THEN
776: x_return_status := fnd_api.g_ret_sts_error;
777: fnd_message.set_name('POS', 'POS_CRSUSER_PERSON_PARTY_NULL');
778: fnd_msg_pub.ADD;
779: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
780: RETURN;
781: END IF;
784: FETCH l_party_cur INTO l_party_rec;
785: IF l_party_cur%notfound THEN
786: CLOSE l_party_cur;
787: x_return_status := fnd_api.g_ret_sts_error;
788: fnd_message.set_name('POS', 'POS_CRSUSER_BAD_PERSON_PARTYID');
789: fnd_message.set_token('PERSON_PARTY_ID', p_person_party_id);
790: fnd_msg_pub.ADD;
791: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
792: RETURN;
785: IF l_party_cur%notfound THEN
786: CLOSE l_party_cur;
787: x_return_status := fnd_api.g_ret_sts_error;
788: fnd_message.set_name('POS', 'POS_CRSUSER_BAD_PERSON_PARTYID');
789: fnd_message.set_token('PERSON_PARTY_ID', p_person_party_id);
790: fnd_msg_pub.ADD;
791: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
792: RETURN;
793: END IF;
794: CLOSE l_party_cur;
795:
796: IF l_party_rec.status <> 'A' THEN
797: x_return_status := fnd_api.g_ret_sts_error;
798: fnd_message.set_name('POS', 'POS_CRSUSER_PERSON_PARTY_INACT');
799: fnd_message.set_token('PERSON_PARTY_ID', p_person_party_id);
800: fnd_msg_pub.ADD;
801: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
802: RETURN;
795:
796: IF l_party_rec.status <> 'A' THEN
797: x_return_status := fnd_api.g_ret_sts_error;
798: fnd_message.set_name('POS', 'POS_CRSUSER_PERSON_PARTY_INACT');
799: fnd_message.set_token('PERSON_PARTY_ID', p_person_party_id);
800: fnd_msg_pub.ADD;
801: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
802: RETURN;
803: END IF;
803: END IF;
804:
805: IF l_party_rec.party_type <> 'PERSON' THEN
806: x_return_status := fnd_api.g_ret_sts_error;
807: fnd_message.set_name('POS', 'POS_CRSUSER_PARTY_NOT_PERSON');
808: fnd_message.set_token('PERSON_PARTY_ID', p_person_party_id);
809: fnd_msg_pub.ADD;
810: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
811: RETURN;
804:
805: IF l_party_rec.party_type <> 'PERSON' THEN
806: x_return_status := fnd_api.g_ret_sts_error;
807: fnd_message.set_name('POS', 'POS_CRSUSER_PARTY_NOT_PERSON');
808: fnd_message.set_token('PERSON_PARTY_ID', p_person_party_id);
809: fnd_msg_pub.ADD;
810: fnd_msg_pub.count_and_get(p_count => x_msg_count, p_data => x_msg_data);
811: RETURN;
812: END IF;
836: WHEN VALUE_ERROR THEN
837: --Throwing error if the conversion to number didn't happen due to invalid characters
838: --Only VALUE_ERROR can occur while conversion
839: x_return_status := fnd_api.g_ret_sts_error;
840: fnd_message.set_name('POS', 'POS_SUPP_USER_PWD_EXP_ERROR');
841: fnd_message.set_token('POS_PROFILE_OPTION_NAME', 'POS: Supplier User Account Password Expiration Days');
842: x_msg_data := fnd_message.get;
843: raise_application_error(-20001,x_msg_data,false);
844: RETURN;
837: --Throwing error if the conversion to number didn't happen due to invalid characters
838: --Only VALUE_ERROR can occur while conversion
839: x_return_status := fnd_api.g_ret_sts_error;
840: fnd_message.set_name('POS', 'POS_SUPP_USER_PWD_EXP_ERROR');
841: fnd_message.set_token('POS_PROFILE_OPTION_NAME', 'POS: Supplier User Account Password Expiration Days');
842: x_msg_data := fnd_message.get;
843: raise_application_error(-20001,x_msg_data,false);
844: RETURN;
845: END;
838: --Only VALUE_ERROR can occur while conversion
839: x_return_status := fnd_api.g_ret_sts_error;
840: fnd_message.set_name('POS', 'POS_SUPP_USER_PWD_EXP_ERROR');
841: fnd_message.set_token('POS_PROFILE_OPTION_NAME', 'POS: Supplier User Account Password Expiration Days');
842: x_msg_data := fnd_message.get;
843: raise_application_error(-20001,x_msg_data,false);
844: RETURN;
845: END;
846: END IF;
1036: aname => 'ENTERPRISE_NAME',
1037: avalue => l_enterprise_name
1038: );
1039:
1040: -- Bug 8325979 - Following attributes have been replaced with FND Messages
1041:
1042: wf_engine.SetItemAttrText (itemtype => l_itemtype,
1043: itemkey => l_itemkey,
1044: aname => 'POS_APPRV_REG_USER_SUBJECT',
1292: --Name: GET_SUPP_USER_ACCNT_SUBJECT
1293: --Type:
1294: -- Function
1295: --Function:
1296: -- It returns the tokens replaced FND message to Notification Message Subject
1297: --Function Usage:
1298: -- This function is used to replace the workflow message subject by FND Message & its tokens
1299: --Logic Implemented:
1300: -- The FND Message Name 'POS_APPRV_REG_USER_SUBJECT' will be replaced with
1294: -- Function
1295: --Function:
1296: -- It returns the tokens replaced FND message to Notification Message Subject
1297: --Function Usage:
1298: -- This function is used to replace the workflow message subject by FND Message & its tokens
1299: --Logic Implemented:
1300: -- The FND Message Name 'POS_APPRV_REG_USER_SUBJECT' will be replaced with
1301: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1302: -- Then, replaced FND message will be return to the corresponding attribute
1296: -- It returns the tokens replaced FND message to Notification Message Subject
1297: --Function Usage:
1298: -- This function is used to replace the workflow message subject by FND Message & its tokens
1299: --Logic Implemented:
1300: -- The FND Message Name 'POS_APPRV_REG_USER_SUBJECT' will be replaced with
1301: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1302: -- Then, replaced FND message will be return to the corresponding attribute
1303: --Parameters:
1304: -- Enterprise Name
1298: -- This function is used to replace the workflow message subject by FND Message & its tokens
1299: --Logic Implemented:
1300: -- The FND Message Name 'POS_APPRV_REG_USER_SUBJECT' will be replaced with
1301: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1302: -- Then, replaced FND message will be return to the corresponding attribute
1303: --Parameters:
1304: -- Enterprise Name
1305: --IN:
1306: -- Enterprise Name
1316: l_document VARCHAR2(32000);
1317:
1318: BEGIN
1319:
1320: fnd_message.set_name('POS','POS_APPRV_REG_USER_SUBJECT');
1321: fnd_message.set_token('ENTERPRISE_NAME', p_enterprise_name);
1322: l_document := fnd_message.get;
1323: RETURN l_document;
1324: END GET_SUPP_USER_ACCNT_SUBJECT;
1317:
1318: BEGIN
1319:
1320: fnd_message.set_name('POS','POS_APPRV_REG_USER_SUBJECT');
1321: fnd_message.set_token('ENTERPRISE_NAME', p_enterprise_name);
1322: l_document := fnd_message.get;
1323: RETURN l_document;
1324: END GET_SUPP_USER_ACCNT_SUBJECT;
1325:
1318: BEGIN
1319:
1320: fnd_message.set_name('POS','POS_APPRV_REG_USER_SUBJECT');
1321: fnd_message.set_token('ENTERPRISE_NAME', p_enterprise_name);
1322: l_document := fnd_message.get;
1323: RETURN l_document;
1324: END GET_SUPP_USER_ACCNT_SUBJECT;
1325:
1326: -------------------------------------------------------------------------------
1328: --Name: GENERATE_SUPP_USER_ACCNT_BODY
1329: --Type:
1330: -- Procedure
1331: --Procedure:
1332: -- It returns the tokens replaced FND message to Notification Message Body
1333: --Procedure Usage:
1334: -- It is being used to replace the workflow message Body by FND Message & its tokens
1335: --Logic Implemented:
1336: -- For HTML Body:
1330: -- Procedure
1331: --Procedure:
1332: -- It returns the tokens replaced FND message to Notification Message Body
1333: --Procedure Usage:
1334: -- It is being used to replace the workflow message Body by FND Message & its tokens
1335: --Logic Implemented:
1336: -- For HTML Body:
1337: -- The FND Message Name 'POS_APPRV_REG_USER_HTML_BODY' will be replaced with
1338: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1333: --Procedure Usage:
1334: -- It is being used to replace the workflow message Body by FND Message & its tokens
1335: --Logic Implemented:
1336: -- For HTML Body:
1337: -- The FND Message Name 'POS_APPRV_REG_USER_HTML_BODY' will be replaced with
1338: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1339: -- Then, replaced FND message will be return to the corresponding attribute
1340: -- For TEXT Body:
1341: -- The FND Message Name 'POS_APPRV_REG_USER_TEXT_BODY' will be replaced with
1335: --Logic Implemented:
1336: -- For HTML Body:
1337: -- The FND Message Name 'POS_APPRV_REG_USER_HTML_BODY' will be replaced with
1338: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1339: -- Then, replaced FND message will be return to the corresponding attribute
1340: -- For TEXT Body:
1341: -- The FND Message Name 'POS_APPRV_REG_USER_TEXT_BODY' will be replaced with
1342: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1343: -- Then, replaced FND message will be return to the corresponding attribute
1337: -- The FND Message Name 'POS_APPRV_REG_USER_HTML_BODY' will be replaced with
1338: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1339: -- Then, replaced FND message will be return to the corresponding attribute
1340: -- For TEXT Body:
1341: -- The FND Message Name 'POS_APPRV_REG_USER_TEXT_BODY' will be replaced with
1342: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1343: -- Then, replaced FND message will be return to the corresponding attribute
1344: --Parameters:
1345: -- document_id
1339: -- Then, replaced FND message will be return to the corresponding attribute
1340: -- For TEXT Body:
1341: -- The FND Message Name 'POS_APPRV_REG_USER_TEXT_BODY' will be replaced with
1342: -- corresponding Message Text and tokens inside the Message Text also be replaced.
1343: -- Then, replaced FND message will be return to the corresponding attribute
1344: --Parameters:
1345: -- document_id
1346: --IN:
1347: -- document_id
1393: l_note :='';
1394:
1395: IF display_type = 'text/html' THEN
1396: l_disp_type:= display_type;
1397: fnd_message.set_name('POS','POS_APPRV_REG_USER_HTML_BODY');
1398: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1399: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1400: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1401: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1394:
1395: IF display_type = 'text/html' THEN
1396: l_disp_type:= display_type;
1397: fnd_message.set_name('POS','POS_APPRV_REG_USER_HTML_BODY');
1398: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1399: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1400: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1401: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1402: fnd_message.set_token('CONTACT_EMAIL',l_email);
1395: IF display_type = 'text/html' THEN
1396: l_disp_type:= display_type;
1397: fnd_message.set_name('POS','POS_APPRV_REG_USER_HTML_BODY');
1398: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1399: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1400: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1401: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1402: fnd_message.set_token('CONTACT_EMAIL',l_email);
1403: fnd_message.set_token('NOTE',l_note);
1396: l_disp_type:= display_type;
1397: fnd_message.set_name('POS','POS_APPRV_REG_USER_HTML_BODY');
1398: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1399: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1400: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1401: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1402: fnd_message.set_token('CONTACT_EMAIL',l_email);
1403: fnd_message.set_token('NOTE',l_note);
1404: l_document := l_document || NL || NL || fnd_message.get;
1397: fnd_message.set_name('POS','POS_APPRV_REG_USER_HTML_BODY');
1398: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1399: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1400: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1401: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1402: fnd_message.set_token('CONTACT_EMAIL',l_email);
1403: fnd_message.set_token('NOTE',l_note);
1404: l_document := l_document || NL || NL || fnd_message.get;
1405: WF_NOTIFICATION.WriteToClob(document, l_document);
1398: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1399: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1400: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1401: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1402: fnd_message.set_token('CONTACT_EMAIL',l_email);
1403: fnd_message.set_token('NOTE',l_note);
1404: l_document := l_document || NL || NL || fnd_message.get;
1405: WF_NOTIFICATION.WriteToClob(document, l_document);
1406:
1399: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1400: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1401: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1402: fnd_message.set_token('CONTACT_EMAIL',l_email);
1403: fnd_message.set_token('NOTE',l_note);
1404: l_document := l_document || NL || NL || fnd_message.get;
1405: WF_NOTIFICATION.WriteToClob(document, l_document);
1406:
1407: ELSE
1400: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1401: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1402: fnd_message.set_token('CONTACT_EMAIL',l_email);
1403: fnd_message.set_token('NOTE',l_note);
1404: l_document := l_document || NL || NL || fnd_message.get;
1405: WF_NOTIFICATION.WriteToClob(document, l_document);
1406:
1407: ELSE
1408: l_disp_type:= display_type;
1405: WF_NOTIFICATION.WriteToClob(document, l_document);
1406:
1407: ELSE
1408: l_disp_type:= display_type;
1409: fnd_message.set_name('POS','POS_APPRV_REG_USER_TEXT_BODY');
1410: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1411: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1412: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1413: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1406:
1407: ELSE
1408: l_disp_type:= display_type;
1409: fnd_message.set_name('POS','POS_APPRV_REG_USER_TEXT_BODY');
1410: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1411: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1412: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1413: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1414: fnd_message.set_token('CONTACT_EMAIL',l_email);
1407: ELSE
1408: l_disp_type:= display_type;
1409: fnd_message.set_name('POS','POS_APPRV_REG_USER_TEXT_BODY');
1410: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1411: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1412: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1413: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1414: fnd_message.set_token('CONTACT_EMAIL',l_email);
1415: fnd_message.set_token('NOTE',l_note);
1408: l_disp_type:= display_type;
1409: fnd_message.set_name('POS','POS_APPRV_REG_USER_TEXT_BODY');
1410: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1411: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1412: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1413: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1414: fnd_message.set_token('CONTACT_EMAIL',l_email);
1415: fnd_message.set_token('NOTE',l_note);
1416: l_document := l_document || NL || NL || fnd_message.get;
1409: fnd_message.set_name('POS','POS_APPRV_REG_USER_TEXT_BODY');
1410: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1411: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1412: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1413: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1414: fnd_message.set_token('CONTACT_EMAIL',l_email);
1415: fnd_message.set_token('NOTE',l_note);
1416: l_document := l_document || NL || NL || fnd_message.get;
1417: WF_NOTIFICATION.WriteToClob(document, l_document);
1410: fnd_message.set_token('ENTERPRISE_NAME',l_enterprisename);
1411: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1412: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1413: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1414: fnd_message.set_token('CONTACT_EMAIL',l_email);
1415: fnd_message.set_token('NOTE',l_note);
1416: l_document := l_document || NL || NL || fnd_message.get;
1417: WF_NOTIFICATION.WriteToClob(document, l_document);
1418:
1411: fnd_message.set_token('LOGON_PAGE_URL',l_url);
1412: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1413: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1414: fnd_message.set_token('CONTACT_EMAIL',l_email);
1415: fnd_message.set_token('NOTE',l_note);
1416: l_document := l_document || NL || NL || fnd_message.get;
1417: WF_NOTIFICATION.WriteToClob(document, l_document);
1418:
1419: END IF;
1412: fnd_message.set_token('ASSIGNED_USER_NAME',l_username);
1413: fnd_message.set_token('FIRST_LOGON_KEY',l_password);
1414: fnd_message.set_token('CONTACT_EMAIL',l_email);
1415: fnd_message.set_token('NOTE',l_note);
1416: l_document := l_document || NL || NL || fnd_message.get;
1417: WF_NOTIFICATION.WriteToClob(document, l_document);
1418:
1419: END IF;
1420: