0% found this document useful (0 votes)
375 views2 pages

Sales Rep Creation Sample Code N

This document contains PL/SQL code to create a new sales representative record by calling an API, passing in parameters like the sales credit type, representative name and details. It fetches the sales credit type ID, calls the API which returns status and message, and outputs the status, error message if any, and new sales representative ID.

Uploaded by

raj_reddy1432004
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
375 views2 pages

Sales Rep Creation Sample Code N

This document contains PL/SQL code to create a new sales representative record by calling an API, passing in parameters like the sales credit type, representative name and details. It fetches the sales credit type ID, calls the API which returns status and message, and outputs the status, error message if any, and new sales representative ID.

Uploaded by

raj_reddy1432004
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

DECLARE CURSOR get_credit_id (v_name VARCHAR2) IS SELECT sales_credit_type_id FROM oe_sales_credit_types WHERE NAME = v_name; l_credit_id NUMBER; l_salesrep_id

NUMBER; l_msg_count NUMBER; l_msg_data VARCHAR2 (2000); l_return_status VARCHAR2 (1); l_msg_index_out NUMBER; BEGIN OPEN get_credit_id ('Quota Sales Credit'); FETCH get_credit_id INTO l_credit_id; CLOSE get_credit_id; mo_global.set_policy_context ('S','204'); ---Set the ORG if being run from SQLPLUS jtf_rs_salesreps_pub.create_salesrep (p_api_version => 1.0, p_init_msg_list => 'T', p_commit => 'T', p_resource_id => 10103, ----Get the resour ce id from JTF_RS_RESOURCE_EXTNS p_sales_credit_type_id => l_credit_id, p_name => 'Brown, Mr. Tom Peter', ----Name of the resource p_status => NULL, p_start_date_active => SYSDATE, p_end_date_active => NULL, p_gl_id_rev => NULL, p_gl_id_freight => NULL, p_gl_id_rec => NULL, p_set_of_books_id => 1, ------Replace with your set of Books ID p_salesrep_number => 'ABCD00992', p_email_address => '[email protected]', ----Repl ace with Email ID of the user p_wh_update_date => SYSDATE, p_sales_tax_geocode => NULL, p_sales_tax_inside_city_limits => NULL, x_return_status => l_return_status, x_msg_count => l_msg_count, x_msg_data => l_msg_data, x_salesrep_id => l_salesrep_id ); DBMS_OUTPUT.put_line ('return status is ' || l_return_status); fnd_msg_pub.get (p_msg_index => 1, p_encoded => 'F', p_data => l_msg_data, p_msg_index_out => l_msg_index_out ); DBMS_OUTPUT.put_line ('API Error Message : ' || l_msg_data); DBMS_OUTPUT.put_line ('msg data is ' || l_msg_data); DBMS_OUTPUT.put_line ('Sales Rep id is ' || l_salesrep_id);

----Pass the Sales Quota Type

END;

You might also like