Category Archives: Scripts

TCA Create Organization API

Create Organization API

EXAMPLE ON RUNNING TCA API
Running The Create Organization API
Name of the API : CREATE ORGANIZATION API

Base Tables Affected : 

  • HZ_PARTIES
  • HZ_ORGANIZATION_PROFILES

PL/SQL Procedure used : CREATE_ORGANIZATION
Package Used : HZ_PARTY_V2PUB
Mandatory Parameters :

  • p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE
  • p_organization_rec IN ORGANIZATION_REC_TYPE
  • x_return_status OUT VARCHAR2
  • x_msg_count OUT NUMBER
  • x_msg_data OUT VARCHAR2
  • x_party_id OUT NUMBER
  • x_party_number OUT VARCHAR2
  • x_profile_id OUT NUMBER

Procedure:

 General Tips for Running the Create Organization API:

a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createorg.txt)
b) Enter the values for the Parameters from inside the script file itself unless it is required to Enter some value from the SQL Prompt.
c) Set the organization id before running the script as :
d) EXEC fnd_client_info.set_org_context(<orgid>); for 11i
OR EXEC mo_global.init (‘AR’);
EXEC mo_global.set_org_context(<org_id>, NULL, ‘AR’);
EXEC mo_global.set_policy_context(‘S’, <org_id>);

Ensure that the Profile Option HZ : Generate Party Number is Set to ‘Yes’
at Site Level.

Code for Create Organization API:

Output of the Create Organization Script:

return_status=S
count=0
Msg_data =
Party Id=546712
Party_Number=60413
Organization_Name=NewAOA
CreatedBy=TCA_V2_API
Profile Id=267433

Script To Verify whether the Create Organization API is successful:

 

Related posts: