Party Contact API Use

This chapter describes Party Contact APIs. The provided information includes: PL/SQL record structure and procedure, Java inner class and method, and parameter descriptions and validations.

This chapter covers the following topics:

Party Contact APIs

PL/SQL Package Name: HZ_PARTY_CONTACT_V2PUB

Java Class Name: HzPartyContactV2Pub

PL/SQL Record Structure for Org Contact

TYPE org_contact_rec_type IS RECORD(
    org_contact_id                      NUMBER,
    comments                            VARCHAR2(240),
    contact_number                      VARCHAR2(30),
    department_code                     VARCHAR2(30),
    department                          VARCHAR2(60),
    title                               VARCHAR2(30),
    job_title                           VARCHAR2(100),
    decision_maker_flag                 VARCHAR2(1),
    job_title_code                      VARCHAR2(30),
    reference_use_flag                  VARCHAR2(1),
    rank                                VARCHAR2(30),
    party_site_id                       NUMBER,
    orig_system_reference               VARCHAR2(240),
    orig_system                         VARCHAR2(30),    
    attribute_category                  VARCHAR2(30),
    attribute1                          VARCHAR2(150),
    attribute2                          VARCHAR2(150),
    attribute3                          VARCHAR2(150),
    attribute4                          VARCHAR2(150),
    attribute5                          VARCHAR2(150),
    attribute6                          VARCHAR2(150),
    attribute7                          VARCHAR2(150),
    attribute8                          VARCHAR2(150),
    attribute9                          VARCHAR2(150),
    attribute10                         VARCHAR2(150),
    attribute11                         VARCHAR2(150),
    attribute12                         VARCHAR2(150),
    attribute13                         VARCHAR2(150),
    attribute14                         VARCHAR2(150),
    attribute15                         VARCHAR2(150),
    attribute16                         VARCHAR2(150),
    attribute17                         VARCHAR2(150),
    attribute18                         VARCHAR2(150),
    attribute19                         VARCHAR2(150),
    attribute20                         VARCHAR2(150),
    attribute21                         VARCHAR2(150),
    attribute22                         VARCHAR2(150),
    attribute23                         VARCHAR2(150),
    attribute24                         VARCHAR2(150),
    created_by_module                   VARCHAR2(150),
    application_id                      NUMBER,
    party_rel_rec                       HZ_RELATIONSHIP_V2PUB.relationship_rec_type:=HZ_RELATIONSHIP_V2PUB.G_MISS_REL_REC
)

PL/SQL Record Structure for Org Contact Role

TYPE org_contact_role_rec_type      IS RECORD(       
    org_contact_role_id             NUMBER,
    role_type                       VARCHAR2(30),
    primary_flag                    VARCHAR2(1),
    org_contact_id                  NUMBER,
    orig_system_reference           VARCHAR2(240),
    orig_system                     VARCHAR2(30),    
    role_level                      VARCHAR2(30),
    primary_contact_per_role_type   VARCHAR2(1),
    status                          VARCHAR2(1),
    created_by_module               VARCHAR2(150),
    application_id                  NUMBER
)

Java Inner Class for Org Contact

public static class OrgContactRec {
    public BigDecimal               org_ contact_id;
    public String                   comments;
    public String                   contact_number;
    public String                   department_code;
    public String                   department;
    public String                   title;
    public String                   job_title;
    public String                   decision_maker_flag;
    public String                   job_title_code;
    public String                   reference_use_flag;
    public String                   rank;
    public BigDecimal               party_site_id;
    public String                   orig_system_reference;
    public String                   orig_system;
    public String                   attribute_category;
    public String                   attribute1;
    public String                   attribute2;
    public String                   attribute3;
    public String                   attribute4;
    public String                   attribute5;
    public String                   attribute6;
    public String                   attribute7;
    public String                   attribute8;
    public String                   attribute9;
    public String                   attribute10;
    public String                   attribute11;
    public String                   attribute12;
    public String                   attribute13;
    public String                   attribute14;
    public String                   attribute15;
    public String                   attribute16;
    public String                   attribute17;
    public String                   attribute18;
    public String                   attribute19;
    public String                   attribute20;
    public String                   attribute21;
    public String                   attribute22;
    public String                   attribute23;
    public String                   attribute24;
    public String                   created_by_module;
    public BigDecimal               application_id;
          
    party_rel_rec;
    public HzRelationshipV2Pub.RelationshipRec
    public OrgContactRec();
    public OrgContactRec(boolean __RosettaUseGMISSValues);
}

Java Inner Class for Org Contact Role

public static class OrgContactRoleRec {
    public BigDecimal                   org_contact_role_id;
    public String                       role_type;
    public String                       primary_flag;
    public BigDecimal                   org_contact_id;
    public String                       orig_system_reference;
    public String                       orig_system;
    public String                       role_level;
    public String                       primary_contact_per_role_type;
    public String                       status;
    public String                       created_by_module;
    public BigDecimal                   application_id;
    
    public OrgContactRoleRec();
    public OrgContactRoleRec(boolean __RosettaUseGMISSValues);
}

Create Org Contact API

Description

This routine is used to create a Contact person for an organization or person. The API creates a record in the HZ_ORG_CONTACTS table. It additionally creates a relationship record in the HZ_RELATIONSHIPS table using the contact person as the subject, the organization or person as object and relationship type and code passed by the caller. A reverse relationship record is also created at the same time. There is a denormalized party record of type PARTY_RELATIONSHIP created for the relationship depending on relationship type set up for the relationship that is being used for the org contact.

If orig_system is passed in, the API also creates a record in the HZ_ORIG_SYS_REFERENCES table to store the mapping between the source system reference and the TCA primary key.

PL/SQL Procedure

PROCEDURE create_org_contact (
    p_init_msg_list         IN      VARCHAR2:= FND_API.G_FALSE,
    p_org_contact_rec       IN      ORG_CONTACT_REC_TYPE,
    x_org_contact_id        OUT     NUMBER,
    x_party_rel_id          OUT     NUMBER,
    x_party_id              OUT     NUMBER,
    x_party_number          OUT     VARCHAR2,
    x_return_status         OUT     VARCHAR2,
    x_msg_count             OUT     NUMBER,
    x_msg_data              OUT     VARCHAR2
)

Java Method

public static void createOrgContact(
    OracleConnection_connection,
    String                          p_init_msg_list,
    OrgContactRec                   p_org_contact_rec,
    BigDecimal [ ]                  x_org_contact_id,
    BigDecimal [ ]                  x_party_rel_id,
    BigDecimal [ ]                  x_party_id,
    String [ ]                      x_party_number,
    String [ ]                      x_return_status,
    BigDecimal [ ]                  x_msg_count,
    String [ ]                      x_msg_data
) throws SQLException;

Parameter Description and Validation

The following tables list information about the parameters in the Create Org Contact API. The tables include the parameter names, the type of each parameter, the data type of each parameter, the necessity of the parameter, and other information about the parameter such as validation, defaults, and other comments.

Parameter Name Type Data Type Required Validation, Default, Comment
org_contact_id IN NUMBER No Validation: Unique if passed in, else generated from sequence.
comments IN VARCHAR2 No  
contact_number IN VARCHAR2 Yes/No Comment: If HZ_GENERATE_CONTACT_NUMBER= Y or null and caller does not pass any value, then generated from sequence, otherwise caller is passed value is accepted.
department_code IN VARCHAR2 No Validation: Validated against AR lookup type DEPARTMENT_TYPE.
department IN VARCHAR2 No  
title IN VARCHAR2 No Comment: This parameter is no longer used. Use hz_parties.person_pre_name_adjunct instead.
job_title IN VARCHAR2 No  
decision_maker_flag IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO
job_title_code IN VARCHAR2 No Validation: Validated against AR lookup type RESPONSIBILITY
reference_use_flag IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO
rank IN VARCHAR2 No  
party_site_id IN NUMBER No Validation: Foreign key to HZ_PARTY_SITES.PARTY_SITE_ID. If a value is passed, then the party_id of the party site should be same as the object_id of the relationship to be created for this org contact.
orig_system_reference IN VARCHAR2 No Default: org_contact_id
Validation: If orig_system is passed in, then orig_system_reference is required.
orig_system IN VARCHAR2 No Validation: Foreign key to HZ_ORIG_SYSTEMS.orig_system.
attribute_category IN VARCHAR2 No  
attribute1 IN VARCHAR2 No  
attribute2 IN VARCHAR2 No  
attribute3 IN VARCHAR2 No  
attribute4 IN VARCHAR2 No  
attribute5 IN VARCHAR2 No  
attribute6 IN VARCHAR2 No  
attribute7 IN VARCHAR2 No  
attribute8 IN VARCHAR2 No  
attribute9 IN VARCHAR2 No  
attribute10 IN VARCHAR2 No  
attribute11 IN VARCHAR2 No  
attribute12 IN VARCHAR2 No  
attribute13 IN VARCHAR2 No  
attribute14 IN VARCHAR2 No  
attribute15 IN VARCHAR2 No  
attribute16 IN VARCHAR2 No  
attribute17 IN VARCHAR2 No  
attribute18 IN VARCHAR2 No  
attribute19 IN VARCHAR2 No  
attribute20 IN VARCHAR2 No  
attribute21 IN VARCHAR2 No  
attribute22 IN VARCHAR2 No  
attribute23 IN VARCHAR2 No  
attribute24 IN VARCHAR2 No  
created_by_module IN VARCHAR2 Yes Validation: Mandatory attribute. Validated against AR lookup type HZ_CREATED_BY_MODULE.
application_id IN NUMBER No Comment: Text to indicate application from which creation of record is initiated.
party_rel_rec Record Type Attributes
Parameter Name Type Data Type Required Validation, Default, Comment
relationship_id IN NUMBER No Validation: Unique if passed in, else generated from sequence.
subject_id IN NUMBER Yes Validation:
  • Mandatory attribute

  • Foreign key to HZ_PARTIES.PARTY_ID


Comment: Pass the party_id of the contact person here.
subject_type IN VARCHAR2 Yes Validation:
  • Mandatory attribute

  • Foreign key to FND_OBJECT_INSTANCE_SETS.INSTANCESET_NAME


Comment: Pass the party_type of the subject person, which is PERSON here.
subject_table_name IN VARCHAR2 Yes Validation:
  • Mandatory attribute

  • Foreign key to FND_OBJECTS.OBJ.NAME


Comment: Pass HZ_PARTIES for the table name of the source of the subject.
object_id IN NUMBER Yes Validation:
  • Mandatory attribute

  • Foreign key to HZ_PARTIES.PARTY_ID


Comment: Pass the party_id of the organization or person for which you are creating the contact.
object_type IN VARCHAR2 Yes Validation:
  • Mandatory attribute

  • Foreign key to FND_OBJECT_INSTANCE_SETS.INSTANCE_SET_NAME


Comment: Pass ORGANIZATION or PERSON depending on whether you are creating contact for an organization or for a person.
object_table_name IN VARCHAR2 No Validation:
  • Mandatory attribute

  • Foreign key to FND_OBJECTS.OBJ_NAME


Comment: Pass HZ_PARTIES as the table name that is the source of the object.
relationship_code IN VARCHAR2 No Validation:
  • Mandatory attribute

  • Validated against AR lookup type PARTY_RELATIONS_TYPE

  • Required to be a valid forward_rel_code for the particular relationship type requested.

relationship_type IN VARCHAR2 No Validation:
  • Mandatory attribute

  • Must be a valid relationship_type from the HZ_RELATIONSHIP_TYPE table for the combination of subject_type, object_type, and relationship_code passed.

comments IN VARCHAR2 No  
start_date IN DATE No Validation: Mandatory attribute
end_date IN DATE No Validation: Must not be less than start_date
Default: 31-DEC-4712
status IN VARCHAR2 No Validation: Validated against AR lookup type REGISTRY_STATUS
Default: A
content_source_type IN VARCHAR2 No Comment: This parameter is no longer used. Use actual_content_source.
Validation: Foreign key to HZ_ORIG_SYSTEMS.orig_system with sst_flag value of Y.
Default: USER_ENTERED
attribute_category IN VARCHAR2 No  
attribute1 IN VARCHAR2 No  
attribute2 IN VARCHAR2 No  
attribute3 IN VARCHAR2 No  
attribute4 IN VARCHAR2 No  
attribute5 IN VARCHAR2 No  
attribute6 IN VARCHAR2 No  
attribute7 IN VARCHAR2 No  
attribute8 IN VARCHAR2 No  
attribute9 IN VARCHAR2 No  
attribute10 IN VARCHAR2 No  
attribute11 IN VARCHAR2 No  
attribute12 IN VARCHAR2 No  
attribute13 IN VARCHAR2 No  
attribute14 IN VARCHAR2 No  
attribute15 IN VARCHAR2 No  
attribute16 IN VARCHAR2 No  
attribute17 IN VARCHAR2 No  
attribute18 IN VARCHAR2 No  
attribute19 IN VARCHAR2 No  
attribute20 IN VARCHAR2 No  
created_by_module IN VARCHAR2 Yes Validation: Mandatory attribute. Validated against AR lookup type HZ_CREATED_BY_MODULE.
application_id IN NUMBER No Comment: Text to indicate application from which creation of record is initiated.
party_rec Record Type Attributes        
party_id IN NUMBER Yes Validation: Unique if passed in, otherwise generated from sequence
party_number IN VARCHAR2 Yes/No Validation: Generated by sequence if profile HZ_GENERATE_PARTY_NUMBER is Y, else mandatory
validated_flag IN VARCHAR2 No Default: N
status IN VARCHAR2 No Validation: Validated against AR lookup type REGISTRY_STATUS
Default: A
category_code IN VARCHAR2 No Validation: Validated against lookup type CUSTOMER_CATEGORY
salutation IN VARCHAR2 No  
attribute_category IN VARCHAR2 No  
attribute1 IN VARCHAR2 No  
attribute2 IN VARCHAR2 No  
attribute3 IN VARCHAR2 No  
attribute4 IN VARCHAR2 No  
attribute5 IN VARCHAR2 No  
attribute6 IN VARCHAR2 No  
attribute7 IN VARCHAR2 No  
attribute8 IN VARCHAR2 No  
attribute9 IN VARCHAR2 No  
attribute10 IN VARCHAR2 No  
attribute11 IN VARCHAR2 No  
attribute12 IN VARCHAR2 No  
attribute13 IN VARCHAR2 No  
attribute14 IN VARCHAR2 No  
attribute15 IN VARCHAR2 No  
attribute16 IN VARCHAR2 No  
attribute17 IN VARCHAR2 No  
attribute18 IN VARCHAR2 No  
attribute19 IN VARCHAR2 No  
attribute20 IN VARCHAR2 No  
attribute21 IN VARCHAR2 No  
attribute22 IN VARCHAR2 No  
attribute23 IN VARCHAR2 No  
attribute24 IN VARCHAR2 No  
x_org_contact_id OUT NUMBER No Comment: org_contact_id of the org contact record created
x_party_rel_id OUT NUMBER No Comment: relationship_id of the relationship record created
x_party_id OUT NUMBER No Comment: party_id of the party record created
x_party_number OUT VARCHAR2 No Comment: party_number of the party record created
party_rec Record Type Attributes
Parameter Name Type Data Type Required Validation, Default, Comment
party_id IN NUMBER Yes Validation: Unique if passed in, otherwise generated from sequence
party_number IN VARCHAR2 Yes/No Validation: Generated by sequence if profile HZ_GENERATE_PARTY_NUMBER is Y, else mandatory
validated_flag IN VARCHAR2 No Default: N
status IN VARCHAR2 No Validation: Validated against AR lookup type REGISTRY_STATUS
Default: A
category_code IN VARCHAR2 No Validation: Validated against lookup type CUSTOMER_CATEGORY
salutation IN VARCHAR2 No  
attribute_category IN VARCHAR2 No  
attribute1 IN VARCHAR2 No  
attribute2 IN VARCHAR2 No  
attribute3 IN VARCHAR2 No  
attribute4 IN VARCHAR2 No  
attribute5 IN VARCHAR2 No  
attribute6 IN VARCHAR2 No  
attribute7 IN VARCHAR2 No  
attribute8 IN VARCHAR2 No  
attribute9 IN VARCHAR2 No  
attribute10 IN VARCHAR2 No  
attribute11 IN VARCHAR2 No  
attribute12 IN VARCHAR2 No  
attribute13 IN VARCHAR2 No  
attribute14 IN VARCHAR2 No  
attribute15 IN VARCHAR2 No  
attribute16 IN VARCHAR2 No  
attribute17 IN VARCHAR2 No  
attribute18 IN VARCHAR2 No  
attribute19 IN VARCHAR2 No  
attribute20 IN VARCHAR2 No  
attribute21 IN VARCHAR2 No  
attribute22 IN VARCHAR2 No  
attribute23 IN VARCHAR2 No  
attribute24 IN VARCHAR2 No  
x_org_contact_id OUT NUMBER No Comment: org_contact_id of the org contact record created
x_party_rel_id OUT NUMBER No Comment: relationship_id of the relationship record created
x_party_id OUT NUMBER No Comment: party_id of the party record created
x_party_number OUT VARCHAR2 No Comment: party_number of the party record created

Update Org Contact API

Description

This routine is used to update a Contact person. The contact record in the HZ_ORG_CONTACTS table is updated by this API. Optionally you can update the relevant relationship record in the HZ_RELATIONSHIPS table and underlying party record in the HZ_PARTIES table by calling this API. For that you should pass the corresponding id and object version number.

If the primary key is not passed in, get the primary key from the HZ_ORIG_SYS_REFERENCES table based on orig_system and orig_system_reference if they are not null and unique.

PL/SQL Procedure

PROCEDURE update_org_contact (
    p_init_msg_list                IN       VARCHAR2:= FND_API.G_FALSE,
    p_org_contact_rec              IN       ORG_CONTACT_REC_TYPE,
    p_cont_object_version_number   IN OUT   NUMBER,
    p_rel_object_version_number    IN OUT   NUMBER,
    p_party_object_version_number  IN OUT   NUMBER,
    x_return_status                OUT      VARCHAR2,
    x_msg_count                    OUT      NUMBER,
    x_msg_data                     OUT      VARCHAR2
)

Java Method

public static void updateOrgContact(
    OracleConnection_connection,
    String                          p_init_msg_list,
    OrgContactRec                   p_org_contact_rec,
    BigDecimal [ ]                  p_cont_object_version_number,
    BigDecimal [ ]                  p_rel_object_version_number,
    BigDecimal [ ]                  p_party_object_version_number,
    String [ ]                      x_return_status,
    BigDecimal [ ]                  x_msg_count,
    String [ ]                      x_msg_data
) throws SQLException;

Parameter Description and Validation

The following tables list information about the parameters in the Update Org Contact API. The tables include the parameter names, the type of each parameter, the data type of each parameter, the necessity of the parameter, and other information about the parameter such as validation, defaults, and other comments.

Parameter Name Type Data Type Required Validation, Default, Comment
org_contact_id IN NUMBER Yes Validation: Valid org_contact_id should be passed in.
Comment: Pass the org_contact_id from hz_org_contacts table for this org contact.
comments IN VARCHAR2 No  
contact_number IN VARCHAR2 No  
department_code IN VARCHAR2 No Validation: Validated against AR lookup type DEPARTMENT_TYPE
department IN VARCHAR2 No  
title IN VARCHAR2 No Comment: This parameter is no longer used. Use hz_parties.person_pre_name_adjunct instead.
job_title IN VARCHAR2 No  
decision_maker_flag IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO
job_title_code IN VARCHAR2 No Validation: Validated against AR lookup type RESPONSIBILITY
reference_use_flag IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO
rank IN VARCHAR2 No  
party_site_id IN NUMBER No Validation: Foreign key to HZ_PARTY_SITES.PARTY_SITE_ID. If value passed in, then the party_id of the party site should be same as the object_id of the relationship created for this org contact.
orig_system_reference IN VARCHAR2 No Validation: Non updateable, but if a primary key is not passed in, you can pass in any ORIG_SYSTEM and ORIG_SYSTEM_REFERENCE that exists in the HZ_ORIG_SYS_REFERENCE table and unique validation is bypassed. The ORIG_SYSTEM_REFERENCE does not change, but persists in the table.
orig_system IN VARCHAR2 No Validation: Foreign key to HZ_ORIG_SYSTEMS.orig_system.
attribute_category IN VARCHAR2 No  
attribute1 IN VARCHAR2 No  
attribute2 IN VARCHAR2 No  
attribute3 IN VARCHAR2 No  
attribute4 IN VARCHAR2 No  
attribute5 IN VARCHAR2 No  
attribute6 IN VARCHAR2 No  
attribute7 IN VARCHAR2 No  
attribute8 IN VARCHAR2 No  
attribute9 IN VARCHAR2 No  
attribute10 IN VARCHAR2 No  
attribute11 IN VARCHAR2 No  
attribute12 IN VARCHAR2 No  
attribute13 IN VARCHAR2 No  
attribute14 IN VARCHAR2 No  
attribute15 IN VARCHAR2 No  
attribute16 IN VARCHAR2 No  
attribute17 IN VARCHAR2 No  
attribute18 IN VARCHAR2 No  
attribute19 IN VARCHAR2 No  
attribute20 IN VARCHAR2 No  
attribute21 IN VARCHAR2 No  
attribute22 IN VARCHAR2 No  
attribute23 IN VARCHAR2 No  
attribute24 IN VARCHAR2 No  
created_by_module IN VARCHAR2 No Validation: Non updateable if value exists, else validated against AR lookup type HZ_CREATED_BY_MODULE.
application_id IN NUMBER No Validation: Not updateable if a value exists.
party_rel_rec Record Type Attributes
Parameter Name Type Data Type Required Validation, Default, Comment
relationship_id IN NUMBER Yes/No Validation: Valid relationship_id should be passed in
Comment:
  • Pass the relationship_id of the relationship record for this org contact.

  • Pass if you want to update the relationship record.

subject_id IN NUMBER No Validation: Non updateable
subject_type IN VARCHAR2 No Validation: Non updateable
subject_table_name IN VARCHAR2 No Validation: Non updateable
object_id IN NUMBER No Validation: Non updateable
object_type IN VARCHAR2 No Validation: Non updateable
object_table_name IN VARCHAR2 No Validation: Non updateable
relationship_code IN VARCHAR2 No Validation: Non updateable
relationship_type IN VARCHAR2 No Validation: Non updateable
comments IN VARCHAR2 No  
start_date IN DATE No Validation: Cannot be updated to null
end_date IN DATE No Validation: Cannot be less than start_date
status IN VARCHAR2 No Validation:
Validate against AR lookup type REGISTRY_STATUS
Cannot be updated to null
content_source_type IN VARCHAR2 No Comment: This parameter is no longer used. Use actual_content_source.
Validation: Not updateable
attribute_category IN VARCHAR2 No  
attribute1 IN VARCHAR2 No  
attribute2 IN VARCHAR2 No  
attribute3 IN VARCHAR2 No  
attribute4 IN VARCHAR2 No  
attribute5 IN VARCHAR2 No  
attribute6 IN VARCHAR2 No  
attribute7 IN VARCHAR2 No  
attribute8 IN VARCHAR2 No  
attribute9 IN VARCHAR2 No  
attribute10 IN VARCHAR2 No  
attribute11 IN VARCHAR2 No  
attribute12 IN VARCHAR2 No  
attribute13 IN VARCHAR2 No  
attribute14 IN VARCHAR2 No  
attribute15 IN VARCHAR2 No  
attribute16 IN VARCHAR2 No  
attribute17 IN VARCHAR2 No  
attribute18 IN VARCHAR2 No  
attribute19 IN VARCHAR2 No  
attribute20 IN VARCHAR2 No  
created_by_module IN VARCHAR2 No Validation: Non updateable if value exists, else validated against AR lookup type HZ_CREATED_BY_MODULE.
application_id IN NUMBER No Validation: Not updateable if value exists.
party_rec Record Type Attributes
Parameter Name Type Data Type Required Validation, Default, Comment
party_id IN NUMBER Yes/No Validation: Valid party id in HZ_PARTIES.
Comment:
  • Pass party_id of the relationship's party record.

  • Pass if you want to update the party record.

party_number IN VARCHAR2 No Validation: Not updateable
validated_flag IN VARCHAR2 No  
status IN VARCHAR2 No Validation:
  • Validate against AR lookup type REGISTRY_STATUS.

  • Cannot be updated to null.

category_code IN VARCHAR2 No Validation: Validated against lookup type CUSTOMER_CATEGORY.
salutation IN VARCHAR2 No  
attribute_category IN VARCHAR2 No  
attribute1 IN VARCHAR2 No  
attribute2 IN VARCHAR2 No  
attribute3 IN VARCHAR2 No  
attribute4 IN VARCHAR2 No  
attribute5 IN VARCHAR2 No  
attribute6 IN VARCHAR2 No  
attribute7 IN VARCHAR2 No  
attribute8 IN VARCHAR2 No  
attribute9 IN VARCHAR2 No  
attribute10 IN VARCHAR2 No  
attribute11 IN VARCHAR2 No  
attribute12 IN VARCHAR2 No  
attribute13 IN VARCHAR2 No  
attribute14 IN VARCHAR2 No  
attribute15 IN VARCHAR2 No  
attribute16 IN VARCHAR2 No  
attribute17 IN VARCHAR2 No  
attribute18 IN VARCHAR2 No  
attribute19 IN VARCHAR2 No  
attribute20 IN VARCHAR2 No  
attribute21 IN VARCHAR2 No  
attribute22 IN VARCHAR2 No  
attribute23 IN VARCHAR2 No  
attribute24 IN VARCHAR2 No  
p_cont_object_version_number IN
OUT
NUMBER Yes Validation:
  • Mandatory attribute

  • Validated against the value in the database for the existing org contact record


Comment:
  • Pass the current object_version_number of the record from HZ_ORG_CONTACTS

  • Return a new value after update

p_rel_object_version_number IN
OUT
NUMBER Yes/No Validation:
  • Mandatory attribute if relationship to be updated

  • Validated against the value in the database for the existing relationship record


Comment:
  • Pass the current object_version_number of the record from HZ_RELATIONSHIPS

  • Return a new value after update

p_party_object_version_number IN
OUT
NUMBER Yes/No Validation:
  • Mandatory attribute if party to be updated

  • Validated against the value in the database for the existing party record


Comment:
  • Pass the current object_version_number of the record from HZ_PARTIES

  • Return a new value after update

Create Org Contact Role API

Description

This routine is used to create a Contact Role for a contact person. The API creates a record in the HZ_ORG_CONTACT_ROLES table. You can create multiple role records for a particular org contact. For a particular org contact, one of the org contact role records can be marked as Primary and there can be one role record per role type. For a particular organization or person, among all its org contacts, you can mark one role record per role type as primary.

If orig_system is passed in, the API also creates a record in the HZ_ORIG_SYS_REFERENCES table to store the mapping between the source system reference and the TCA primary key.

PL/SQL Procedure

PROCEDURE create_org_contact_role (
   p_init_msg_list                      IN          VARCHAR2:= FND_API.G_FALSE,
   p_org_contact_role_rec               IN          ORG_CONTACT_ROLE_REC_TYPE,
   x_org_contact_role_id                OUT         NUMBER,
   x_return_status                      OUT         VARCHAR2,
   x_msg_count                          OUT         NUMBER,
   x_msg_data                           OUT         VARCHAR2
)

Java Method

public static void createOrgContactRole(
    OracleConnection_connection,
    String                              p_init_msg_list,
    OrgContactRoleRec                   p_org_contact_role_rec,
    BigDecimal [ ]                      x_org_contact_role_id,
    String [ ]                          x_return_status,
    BigDecimal [ ]                      x_msg_count,
    String [ ]                          x_msg_data
) throws SQLException;

Parameter Description and Validation

The following table lists information about the parameters in the Create Org Contact Role API. The table includes the parameter names, the type of each parameter, the data type of each parameter, the necessity of the parameter, and other information about the parameter such as validation, defaults, and other comments.

Parameter Name Type Data Type Required Validation, Default, Comment
org_contact_role_id IN NUMBER No Validation: Unique when passed in, else generated from sequence
role_type IN VARCHAR2 Yes Validation:
  • Mandatory attribute

  • Validated against AR lookup type CONTACT_ROLE_TYPE

primary_flag IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO
org_contact_id IN NUMBER Yes Validation:
Mandatory attribute
Foreign key to HZ_ORG_CONTACTS.ORG_CONTACT_ID
orig_system_reference IN VARCHAR2 No Default: org_contact_role_id
Validation: If orig_system is passed in, then orig_system_reference is required.
orig_system IN VARCHAR2 No Validation: Foreign key to HZ_ORIG_SYSTEMS.orig_system.
role_level IN VARCHAR2 No  
primary_contact_per_role_type IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO
status IN VARCHAR2 No Validation: Validated against AR lookup type REGISTRY_STATUS
Default: A
created_by_module IN VARCHAR2 Yes Validation: Mandatory attribute. Validated against AR lookup type HZ_CREATED_BY_MODULE.
application_id IN NUMBER No Comment: Text to indicate application from which creation of record is initiated
x_org_contact_role_id OUT NUMBER No Comment: Return org_contact_role_id for record created

Other Validations

Update Org Contact Role API

Description

This routine is used to update a contact role record. The API updates the record in the HZ_ORG_CONTACT_ROLES table.

If the primary key is not passed in, get the primary key from the HZ_ORIG_SYS_REFERENCES table based on orig_system and orig_system_reference if they are not null and unique.

PL/SQL Procedure

PROCEDURE update_org_contact_role (
    p_init_msg_list                      IN         VARCHAR2:= FND_API.G_FALSE,
    p_org_contact_role_rec               IN         ORG_CONTACT_ROLE_REC_TYPE,
    p_object_version_number              IN OUT     NUMBER,
    x_return_status                      OUT        VARCHAR2,
    x_msg_count                          OUT        NUMBER,
    x_msg_data                           OUT        VARCHAR2
)

Java Method

public static void updateOrgContactRole(
    OracleConnection_connection,
    String                              p_init_msg_list,
    OrgContactRoleRec                   p_org_contact_role_rec,
    BigDecimal [ ]                      p_object_version_number,
    String [ ]                          x_return_status,
    BigDecimal [ ]                      x_msg_count,
    String [ ]                          x_msg_data
) throws SQLException;

Parameter Description and Validation

The following table lists information about the parameters in the Update Org Contact Role API. The table includes the parameter names, the type of each parameter, the data type of each parameter, the necessity of the parameter, and other information about the parameter such as validation, defaults, and other comments.

Parameter Name Type Data Type Required Validation, Default, Comment
org_contact_role_id IN NUMBER Yes Validation: Valid org_contact_role_id should be passed in
Comment: Pass the org_contact_role_id from hz_org_contact_roles table
role_type IN VARCHAR2 No Validation:
  • Cannot be set to null during update

  • Validated against AR lookup type CONTACT_ROLE_TYPE

primary_flag IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO
org_contact_id IN NUMBER No Validation: Not updateable
orig_system_reference IN VARCHAR2 No Validation: Non updateable, but if a primary key is not passed in, you can pass in any ORIG_SYSTEM and ORIG_SYSTEM_REFERENCE that exists in the HZ_ORIG_SYS_REFERENCE table and unique validation is bypassed. The ORIG_SYSTEM_REFERENCE does not change, but persists in the table.
orig_system IN VARCHAR2 No Validation: Foreign key to HZ_ORIG_SYSTEMS.orig_system.
role_level IN VARCHAR2 No  
primary_contact_per_role_type IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO
status IN VARCHAR2 No Validation:
  • Validated against AR lookup type REGISTRY_STATUS.

  • Cannot be set to null during update.

created_by_module IN VARCHAR2 No Validation: Non updateable if value exists, else validated against AR lookup type HZ_CREATED_BY_MODULE.
application_id IN NUMBER No Validation: Not updateable if value exists.
p_object_version_number IN
OUT
NUMBER Yes Validation:
  • Mandatory attribute.

  • Validated against value in the database for the existing org contact role record.


Comment:
  • Pass the current object_version_number of the record from hz_org_contact_roles.

  • Return new value after update.

Other Validations