Customer Profile and Customer Account Role API Use

This chapter describes Customer Profile and Customer Account Role 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:

Customer Profile APIs

PL/SQL Package Name: HZ_CUSTOMER_PROFILE_V2PUB

Java Class Name: HzCustomerProfileV2Pub

PL/SQL Record Structure for Customer Profile

TYPE customer_profile_rec_type          IS RECORD (
    cust_account_profile_id             NUMBER,
    cust_account_id                     NUMBER,
    status                              VARCHAR2(1),
    collector_id                        NUMBER,
    credit_analyst_id                   NUMBER,
    credit_checking                     VARCHAR2(1),
    next_credit_review_date             DATE,
    tolerance                           NUMBER,
    discount_terms                      VARCHAR2(1),
    dunning_letters                     VARCHAR2(1),
    interest_charges                    VARCHAR2(1),
    send_statements                     VARCHAR2(1),
    credit_balance_statements           VARCHAR2(1),
    credit_hold                         VARCHAR2(1),
    profile_class_id                    NUMBER,
    site_use_id                         NUMBER,
    credit_rating                       VARCHAR2(30),
    risk_code                           VARCHAR2(30),
    standard_terms                      NUMBER,
    override_terms                      VARCHAR2(1),
    interest_period_days                NUMBER,
    payment_grace_days                  NUMBER,
    discount_grace_days                 NUMBER,
    statement_cycle_id                  NUMBER,
    account_status                      VARCHAR2(30),
    percent_collectable                 NUMBER,
    autocash_hierarchy_id               NUMBER,
    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),
    auto_rec_incl_disputed_flag         VARCHAR2(1),
    tax_printing_option                 VARCHAR2(30),
    charge_on_finance_charge_flag       VARCHAR2(1),
    grouping_rule_id                    NUMBER,
    clearing_days                       NUMBER,
    jgzz_attribute_category             VARCHAR2(30),
    jgzz_attribute1                     VARCHAR2(150),
    jgzz_attribute2                     VARCHAR2(150),
    jgzz_attribute3                     VARCHAR2(150),
    jgzz_attribute4                     VARCHAR2(150),
    jgzz_attribute5                     VARCHAR2(150),
    jgzz_attribute6                     VARCHAR2(150),
    jgzz_attribute7                     VARCHAR2(150),
    jgzz_attribute8                     VARCHAR2(150),
    jgzz_attribute9                     VARCHAR2(150),
    jgzz_attribute10                    VARCHAR2(150),
    jgzz_attribute11                    VARCHAR2(150),
    jgzz_attribute12                    VARCHAR2(150),
    jgzz_attribute13                    VARCHAR2(150),
    jgzz_attribute14                    VARCHAR2(150),
    jgzz_attribute15                    VARCHAR2(150),
    global_attribute1                   VARCHAR2(150),
    global_attribute2                   VARCHAR2(150),
    global_attribute3                   VARCHAR2(150),
    global_attribute4                   VARCHAR2(150),
    global_attribute5                   VARCHAR2(150),
    global_attribute6                   VARCHAR2(150),
    global_attribute7                   VARCHAR2(150),
    global_attribute8                   VARCHAR2(150),
    global_attribute9                   VARCHAR2(150),
    global_attribute10                  VARCHAR2(150),
    global_attribute11                  VARCHAR2(150),
    global_attribute12                  VARCHAR2(150),
    global_attribute13                  VARCHAR2(150),
    global_attribute14                  VARCHAR2(150),
    global_attribute15                  VARCHAR2(150),
    global_attribute16                  VARCHAR2(150),
    global_attribute17                  VARCHAR2(150),
    global_attribute18                  VARCHAR2(150),
    global_attribute19                  VARCHAR2(150),
    global_attribute20                  VARCHAR2(150),
    global_attribute_category           VARCHAR2(30),
    cons_inv_flag                       VARCHAR2(1),
    cons_inv_type                       VARCHAR2(30),
    autocash_hierarchy_id_for_adr       NUMBER,
    lockbox_matching_option             VARCHAR2(30),
    created_by_module                   VARCHAR2(150),
    application_id                      NUMBER
    review_cycle                        VARCHAR2(30),
    last_credit_review_date             DATE,
    party_id                            NUMBER
    credit_classification               VARCHAR2(30)
)

PL/SQL Record Structure for Customer Profile Amount

TYPE cust_profile_amt_rec_type          IS RECORD (
    cust_acct_profile_amt_id            NUMBER,
    cust_account_profile_id             NUMBER,
    currency_code                       VARCHAR2(15),
    trx_credit_limit                    NUMBER,
    overall_credit_limit                NUMBER,
    min_dunning_amount                  NUMBER,
    min_dunning_invoice_amount          NUMBER,
    max_interest_charge                 NUMBER,
    min_statement_amount                NUMBER,
    auto_rec_min_receipt_amount         NUMBER,
    interest_rate                       NUMBER,
    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),
    min_fc_balance_amount               NUMBER,
    min_fc_invoice_amount               NUMBER,
    cust_account_id                     NUMBER,
    site_use_id                         NUMBER,
    expiration_date                     DATE,
    jgzz_attribute_category             VARCHAR2(30),
    jgzz_attribute1                     VARCHAR2(150),
    jgzz_attribute2                     VARCHAR2(150),
    jgzz_attribute3                     VARCHAR2(150),
    jgzz_attribute4                     VARCHAR2(150),
    jgzz_attribute5                     VARCHAR2(150),
    jgzz_attribute6                     VARCHAR2(150),
    jgzz_attribute7                     VARCHAR2(150),
    jgzz_attribute8                     VARCHAR2(150),
    jgzz_attribute9                     VARCHAR2(150),
    jgzz_attribute10                    VARCHAR2(150),
    jgzz_attribute11                    VARCHAR2(150),
    jgzz_attribute12                    VARCHAR2(150),
    jgzz_attribute13                    VARCHAR2(150),
    jgzz_attribute14                    VARCHAR2(150),
    jgzz_attribute15                    VARCHAR2(150),
    global_attribute1                   VARCHAR2(150),
    global_attribute2                   VARCHAR2(150),
    global_attribute3                   VARCHAR2(150),
    global_attribute4                   VARCHAR2(150),
    global_attribute5                   VARCHAR2(150),
    global_attribute6                   VARCHAR2(150),
    global_attribute7                   VARCHAR2(150),
    global_attribute8                   VARCHAR2(150),
    global_attribute9                   VARCHAR2(150),
    global_attribute10                  VARCHAR2(150),
    global_attribute11                  VARCHAR2(150),
    global_attribute12                  VARCHAR2(150),
    global_attribute13                  VARCHAR2(150),
    global_attribute14                  VARCHAR2(150),
    global_attribute15                  VARCHAR2(150),
    global_attribute16                  VARCHAR2(150),
    global_attribute17                  VARCHAR2(150),
    global_attribute18                  VARCHAR2(150),
    global_attribute19                  VARCHAR2(150),
    global_attribute20                  VARCHAR2(150),
    global_attribute_category           VARCHAR2(30),
    created_by_module                   VARCHAR2(150),
    application_id                      NUMBER
)

Java Inner Class for Customer Profile

public static class CustomerProfileRec {
    public BigDecimal                   cust_account_profile_id;
    public BigDecimal                   cust_account_id;
    public String                       status;
    public BigDecimal                   collector_id;
    public BigDecimal                   credit_analyst_id;
    public String                       credit_checking;
    public java.sql.Timestamp           next_credit_review_date;
    public BigDecimal                   tolerance;
    public String                       discount_terms;
    public String                       dunning_letters;
    public String                       interest_charges;
    public String                       send_statements;
    public String                       credit_balance_statements;
    public String                       credit_hold;
    public BigDecimal                   profile_class_id;
    public BigDecimal                   site_use_id;
    public String                       credit_rating;
    public String                       risk_code;
    public BigDecimal                   standard_terms;
    public String                       override_terms;
    public BigDecimal                   interest_period_days;
    public BigDecimal                   payment_grace_days;
    public BigDecimal                   discount_grace_days;
    public BigDecimal                   statement_cycle_id;
    public String                       account_status;
    public BigDecimal                   percent_collectable;
    public BigDecimal                   autocash_hierarchy_id;
    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                       auto_rec_incl_disputed_flag;
    public String                       tax_printing_option;
    public String                       charge_on_finance_charge_flag;
    public BigDecimal                   grouping_rule_id;
    public BigDecimal                   clearing_days;
    public String                       jgzz_attribute_category;
    public String                       jgzz_attribute1;
    public String                       jgzz_attribute2;
    public String                       jgzz_attribute3;
    public String                       jgzz_attribute4;
    public String                       jgzz_attribute5;
    public String                       jgzz_attribute6;
    public String                       jgzz_attribute7;
    public String                       jgzz_attribute8;
    public String                       jgzz_attribute9;
    public String                       jgzz_attribute10;
    public String                       jgzz_attribute11;
    public String                       jgzz_attribute12;
    public String                       jgzz_attribute13;
    public String                       jgzz_attribute14;
    public String                       jgzz_attribute15;
    public String                       global_attribute1;
    public String                       global_attribute2;
    public String                       global_attribute3;
    public String                       global_attribute4;
    public String                       global_attribute5;
    public String                       global_attribute6;
    public String                       global_attribute7;
    public String                       global_attribute8;
    public String                       global_attribute9;
    public String                       global_attribute10;
    public String                       global_attribute11;
    public String                       global_attribute12;
    public String                       global_attribute13;
    public String                       global_attribute14;
    public String                       global_attribute15;
    public String                       global_attribute16;
    public String                       global_attribute17;
    public String                       global_attribute18;
    public String                       global_attribute19;
    public String                       global_attribute20;
    public String                       global_attribute_category;
    public String                       cons_inv_flag;
    public String                       cons_inv_type;
    public BigDecimal                   autocash_hierarchy_id_for_adr;
    public String                       lockbox_matching_option;
    public String                       created_by_module;
    public BigDecimal                   application_id;
    public String                       review_cycle;
    public java.sql.Timestamp           last_credit_review_date;
    public BigDecimal                   party_id;
    public String                       credit_classification

    public CustomerProfileRec();
    public CustomerProfileRec(boolean __RosettaUseGMISSValues);
}

Java Inner Class for Customer Profile Amount

public static class CustProfileAmtRec {
    public BigDecimal               cust_acct_profile_amt_id;
    public BigDecimal               cust_account_profile_id;
    public String                   currency_code;
    public BigDecimal               trx_credit_limit;
    public BigDecimal               overall_credit_limit;
    public BigDecimal               min_dunning_amount;
    public BigDecimal               min_dunning_invoice_amount;
    public BigDecimal               max_interest_charge;
    public BigDecimal               min_statement_amount;
    public BigDecimal               auto_rec_min_receipt_amount;
    public BigDecimal               interest_rate;
    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 BigDecimal               min_fc_balance_amount;
    public BigDecimal               min_fc_invoice_amount;
    public BigDecimal               cust_account_id;
    public BigDecimal               site_use_id;
    public java.sql.Timestamp       expiration_date;
    public String                   jgzz_attribute_category;
    public String                   jgzz_attribute1;
    public String                   jgzz_attribute2;
    public String                   jgzz_attribute3;
    public String                   jgzz_attribute4;
    public String                   jgzz_attribute5;
    public String                   jgzz_attribute6;
    public String                   jgzz_attribute7;
    public String                   jgzz_attribute8;
    public String                   jgzz_attribute9;
    public String                   jgzz_attribute10;
    public String                   jgzz_attribute11;
    public String                   jgzz_attribute12;
    public String                   jgzz_attribute13;
    public String                   jgzz_attribute14;
    public String                   jgzz_attribute15;
    public String                   global_attribute1;
    public String                   global_attribute2;
    public String                   global_attribute3;
    public String                   global_attribute4;
    public String                   global_attribute5;
    public String                   global_attribute6;
    public String                   global_attribute7;
    public String                   global_attribute8;
    public String                   global_attribute9;
    public String                   global_attribute10;
    public String                   global_attribute11;
    public String                   global_attribute12;
    public String                   global_attribute13;
    public String                   global_attribute14;
    public String                   global_attribute15;
    public String                   global_attribute16;
    public String                   global_attribute17;
    public String                   global_attribute18;
    public String                   global_attribute19;
    public String                   global_attribute20;
    public String                   global_attribute_category;
    public String                   created_by_module;
    public BigDecimal               application_id;

    public CustProfileAmtRec();
    public CustProfileAmtRec(boolean __RosettaUseGMISSValues);
}

Create Customer Profile API

Description

This routine is used to create a Customer Profile. The API creates a record in the HZ_CUSTOMER_PROFILES table. The profile can be created at party level, at customer level, or at customer site level. It also creates profile amounts based on the value passed for p_create_profile_amt.

If the credit_hold parameter value is Y, then records are inserted into OE_HOLD_SOURCES and OE_ORDER_HOLDS to keep these tables synchronized.

PL/SQL Procedure

PROCEDURE create_customer_profile (
    p_init_msg_list            IN    VARCHAR2:= FND_API.G_FALSE,
    p_customer_profile_rec     IN    CUSTOMER_PROFILE_REC_TYPE,
    p_create_profile_amt       IN    VARCHAR2:= FND_API.G_TRUE,
    x_cust_account_profile_id  OUT   NUMBER,
    x_return_status            OUT   VARCHAR2,
    x_msg_count                OUT   NUMBER,
    x_msg_data                 OUT   VARCHAR2
)

Note: p_create_profile_amt indicates whether to create profile amounts for the customer profile being created. If value equals to FND_API.G_TRUE, profile amounts will be created by copying over the profile amounts for the profile class on which this customer profile is based.

Java Method

public static void createCustomerProfile(
    OracleConnection_connection,
    String                            p_init_msg_list,
    CustomerProfileRec                p_customer_profile_rec,
    String                            p_create_profile_amt,
    BigDecimal [ ]                    x_cust_account_profile_id,
    String [ ]                        x_return_status,
    BigDecimal [ ]                    x_msg_count,
    String [ ]                        x_msg_data
) throws SQLException;

Note: p_create_profile_amt indicates whether to create profile amounts for the customer profile being created. If value equals to HzConstant.getGTrue(), profile amounts will be created by copying over the profile amounts for the profile class on which this customer profile is based.

Parameter Description and Validation

The following table lists information about the parameters in the Create Customer Profile 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
cust_account_profile_id IN NUMBER Yes/No Validation Unique if passed in, else generated from sequence
cust_account_id IN NUMBER No Validation:
  • Foreign key to hz_cust_accounts.cust_account_id

  • One of the following 2 columns need to be not null : cust_account_id and party_id

  • If cust_account_id is not null and party_id is null then:

    • The cust_account_id is a foreign key to hz_cust_accounts.cust_account_id.

    • The party_id in the hz_parties table associated with this cust_account_id must be active.

  • If cust_account_id is null and party_id is not null then:

    • The party_id is a foreign key to an active hz_parties.party_id.

    • The cust_account_id will be defaulted to (-1).

       
  • If cust_account_id is not null and party_id is not null then:

    • The party_id is a foreign key to an active hz_parties.party_id.

    • The party_id and the cust_account_id must be associated in hz_cust_accounts.

  • You can only have one customer profile for one account In this case you can find the party_id in the hz_customer_profiles.party_id column.

  • You can only have one customer profile at party level for a party. In this case the cust_account_id will be defaulted to -1.

status IN VARCHAR2 No Validation: It is a lookup code in lookup type CODE_STATUS
Default: A
collector_id IN NUMBER No Validation: foreign key to ar_collectors
Default: it is defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
credit_analyst_id IN NUMBER No  
credit_checking IN VARCHAR2 No Validation:It is lookup code in lookup type YES/NO
Default: It is defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
next_credit_review_date IN DATE No  
tolerance IN NUMBER No Validation: Must be between -100 and 100.
Default: Defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
discount_terms IN VARCHAR2 No Validation:
  • It is lookup code in lookup YES/NO.

  • If discount_terms = Y, then discount_grace_days should be greater than or equal to 0.

  • If discount_terms = N, then discount_grace_days should be null.


Default: defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
dunning_letters IN VARCHAR2 No Validation:
  • Dunning letters is lookup code in lookup type YES/NO.


Default: defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
interest_charges IN VARCHAR2 No Validation:
  • It is a lookup code in lookup type YES/NO.

  • If interest_charges = Y, then charge_on_finance_charge_flag must have a value and interest_period_days must have a value greater than 0.

  • If interest_charges = N, then charge_on_finance_charge_flag must be null and interest_period_days must be null.


Default: defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
send_statements IN VARCHAR2 No Validation:
  • It is a lookup code in lookup type YES/NO.

  • If send_statements = Y, then statement_cycle_id must have a value and credit_balance_statements must have value.

  • If send_statements = N, then statement_cycle_id must be null and credit_balance_statements must be N.


Default: defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
credit_balance_statements IN VARCHAR2 No Validation:
  • It is a lookup code in lookup type YES/NO.

  • Can be populated if send_statements is Y.


Default: defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
credit_hold IN VARCHAR2 No Validation: It is a lookup code in lookup type YES/NO
Default: defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
profile_class_id IN NUMBER No Validation:
  • If passed in, profile_class_id should be positive.

  • Foreign key to hz_cust_profile_classes and the corresponding profile class should be active


Default: defaulted to the corresponding value of DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
site_use_id IN NUMBER No Validation:
  • Foreign key to hz_cust_site_uses

  • One site use can only have one profile.

  • The customer which the site_use_id belongs to should have the same id as cust_account_id in this profile. In this case cust_account_id is mandatory.

credit_rating IN VARCHAR2 No Validation: Credit Rating is lookup code in AR lookup type CREDIT_RATING
risk_code IN VARCHAR2 No Validation: Risk Code is lookup code in AR lookup type RISK_CODE
standard_terms IN NUMBER No Validation: Must be a valid term_id in RA_TERMS.
override_terms IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO.
interest_period_days IN NUMBER No Validation: Can be entered when interest_charges is Y and it is mandatory.
payment_grace_days IN NUMBER No Validation: Must be greater than zero.
discount_grace_days IN NUMBER No Validation: Can be populated only if discount_terms is Y.
statement_cycle_id IN NUMBER No Validation:
  • Must be a valid statment_cycle_id from AR_STATEMENT_CYCLES.

  • Can be populated if send_statements is Y.

account_status IN VARCHAR2 No Validation: Validated against AR lookup type ACCOUNT_STATUS.
percent_collectable IN NUMBER No Validation: Must be between 0 and 100.
autocash_hierarchy_id IN NUMBER No Validation: Must be a valid autocash_hierarchy_id from AR_AUTOCASH_HIERARCHIES.
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  
auto_rec_incl_disputed_flag IN VARCHAR2 No Validation: It is a lookup code in lookup type YES/NO
Default: Defaulted to the corresponding value of 'DEFAULT PROFILE CLASS (PROFILE_CLASS_ID=0)
tax_printing_option IN VARCHAR2 No Validation: Validated against AR lookup type TAX_PRINTING_OPTION.
charge_on_finance_charge_flag IN VARCHAR2 No Validation: charge_on_finance_charge_flag is lookup code in lookup type YES/NO
grouping_rule_id IN NUMBER No Validation: Must be a valid grouping_rule_id from RA_GROUPING_RULES.
clearing_days IN NUMBER No Validation: Must be greater than zero.
jgzz_attribute_category IN VARCHAR2 No  
jgzz_attribute1 IN VARCHAR2 No  
jgzz_attribute2 IN VARCHAR2 No  
jgzz_attribute3 IN VARCHAR2 No  
jgzz_attribute4 IN VARCHAR2 No  
jgzz_attribute5 IN VARCHAR2 No  
jgzz_attribute6 IN VARCHAR2 No  
jgzz_attribute7 IN VARCHAR2 No  
jgzz_attribute8 IN VARCHAR2 No  
jgzz_attribute9 IN VARCHAR2 No  
jgzz_attribute10 IN VARCHAR2 No  
jgzz_attribute11 IN VARCHAR2 No  
jgzz_attribute12 IN VARCHAR2 No  
jgzz_attribute13 IN VARCHAR2 No  
jgzz_attribute14 IN VARCHAR2 No  
jgzz_attribute15 IN VARCHAR2 No  
global_attribute1 IN VARCHAR2 No  
global_attribute2 IN VARCHAR2 No  
global_attribute3 IN VARCHAR2 No  
global_attribute4 IN VARCHAR2 No  
global_attribute5 IN VARCHAR2 No  
global_attribute6 IN VARCHAR2 No  
global_attribute7 IN VARCHAR2 No  
global_attribute8 IN VARCHAR2 No  
global_attribute9 IN VARCHAR2 No  
global_attribute10 IN VARCHAR2 No  
global_attribute11 IN VARCHAR2 No  
global_attribute12 IN VARCHAR2 No  
global_attribute13 IN VARCHAR2 No  
global_attribute14 IN VARCHAR2 No  
global_attribute15 IN VARCHAR2 No  
global_attribute16 IN VARCHAR2 No  
global_attribute17 IN VARCHAR2 No  
global_attribute18 IN VARCHAR2 No  
global_attribute19 IN VARCHAR2 No  
global_attribute20 IN VARCHAR2 No  
global_attribute_category IN VARCHAR2 No  
cons_inv_flag IN VARCHAR2 No Validation: cons_inv_flag is lookup code in lookup type YES/NO
cons_inv_type IN VARCHAR2 No  
autocash_hierarchy_id_for_adr IN NUMBER No Validation: Must be a valid autocash_hierarchy_id from AR_AUTOCASH_HIERARCHIES.
lockbox_matching_option IN VARCHAR2 No Validation: Validated against AR lookup type ARLPLB_MATCHING_OPTION.
created_by_module IN VARCHAR2 Y 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
review_cycle IN VARCHAR2 No Validation : Validated against AR lookup type PERIODIC_REVIEW_CYCLE.
last_review_date IN DATE No  
party_id IN NUMBER No Validation:
  • One of the following columns cannot be null: cust _account_id and party_id.

  • If cust_account_id is not null and party_id is null, then this is mandatory field.

    • The cust_account_id is a foreign key to hz_cust_accounts.cust_account_id.

    • The party_id in the hz_parties table associated with this cust_account_id must be active.

  • If cust_account_id is null and party_id is not null then

    • The party_id is a foreign key to an active hz_parties.party_id.

    The cust_account_id will be defaulted to (-1).

       
  • If cust_account_id is not null and party_id is not null:

    • The party_id is a foreign key to an active hz_parties.party_id.

    • Party_id and cust_account_id must be associated in hz_cust_accounts.

  • You can only have one customer profile for one account. You can find the party_id in the hz_customer _profiles.party_id column.

  • You can only have one customer profile at party level for a party. The cust_account_id defaults to (-1).

p_create_profile_amt IN VARCHAR2 No Validation: T or F
Comment: Indicates whether profile amounts will be created or not. Default value is FND_API.G_TRUE to create amounts.
x_cust_account_profile_id OUT NUMBER No Comment: Returns cust_account_profile_id for the record created
credit_classification IN VARCHAR2 No Validation: This is a lookup code in lookup_type 'CREDIT_CLASSIFICATION'.
Default: NULL
AUTOMATCH_SET_ID IN NUMBER No  

Other Validations

When creating customer profile, if profile class id is null or FND_API.G_MISS_NUM, we create customer profile based on default profile class, which should have ID 0 and should be in active status. If profile class id is not null, we create customer profile based on this particular profile class. For those columns we can default from profile class (i.e. columns we have in both hz_customer_profiles and hz_cust_profile_classes). If they are passed as null, we will default them from profile class; if they are passed as FND_API.G_MISS_XXX which means user want to set them to null, we will set these columns to null. This rule also applies when we update customer profile and pass profile class id.

Update Customer Profile API

Description

This routine is used to update a Customer Profile. The API updates a record in the HZ_CUSTOMER_PROFILES table. The profile could be at the party level, the customer level, or the customer site level.

If the credit_hold parameter value is Y, then records are inserted into OE_HOLD_SOURCES and OE_ORDER_HOLDS to keep these tables synchronized.

PL/SQL Procedure

PROCEDURE update_customer_profile (
  p_init_msg_list                        IN         VARCHAR2:= FND_API.G_FALSE,
  p_customer_profile_rec                 IN         CUSTOMER_PROFILE_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 updateCustomerProfile(
   OracleConnection_connection,
    String                          p_init_msg_list,
    CustomerProfileRec              p_customer_profile_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 Customer Profile 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
cust_account_profile_id IN NUMBER Yes Validation: valid cust_account_profile_id has to be passed in
Comment: Pass cust_account_profile_id from table hz_customer_profiles
cust_account_id IN NUMBER No Validation: Not updateable
status IN VARCHAR2 No Validation: It is a lookup code in lookup type CODE_STATUS
Default: A
collector_id IN NUMBER No Validation: Foreign key to ar_collectors
credit_analyst_id IN NUMBER No  
credit_checking IN VARCHAR2 No Validation: It is a lookup code in lookup type YES/NO
next_credit_review_date IN DATE No  
tolerance IN NUMBER No Validation:
  • Tolerance cannot be updated to null.

  • Must be between -100 and 100.

discount_terms IN VARCHAR2 No Validation:
  • It is lookup code in lookup YES/NO.

  • If discount_terms = Y, then discount_grace_days should be greater than or equal to 0.

  • If discount_terms = N, then discount_grace_days should be null.

dunning_letters IN VARCHAR2 No Validation:
  • It is lookup code in lookup YES/NO.

interest_charges IN VARCHAR2 No Validation:
  • It is lookup code in lookup type YES/NO.

  • If interest_charges = Y, then charge_on_finance_charge_flag must have a value and interest_period_days must have a value greater than 0.

  • If interest_charges = N, then charge_on_finance_charge_flag must be null and interest_period_days must be null.

send_statements IN VARCHAR2 No Validation:
  • It is lookup code in lookup type YES/NO.

  • If send_statements = Y, then statement_cycle_id must have a value and credit_balance_statements must have a value.

  • If send_statements = N, then statement_cycle_id must be null and credit_balance_statements must be N.

credit_balance_statements IN VARCHAR2 No Validation:
  • It is a lookup code in lookup type YES/NO.

  • Can be populated if send_statments is Y.

credit_hold IN VARCHAR2 No Validation: It is a lookup code in lookup type YES/NO
profile_class_id IN NUMBER No Validation: Cannot be set to null
site_use_id IN NUMBER No Validation: Not updateable
credit_rating IN VARCHAR2 No Validation: Credit Rating is lookup code in lookup type CREDIT_RATING
risk_code IN VARCHAR2 No Validation: Risk Code is a lookup code in lookup type RISK_CODE
standard_terms IN NUMBER No Validation: Must be a valid term_id in RA_TERMS.
override_terms IN VARCHAR2 No Validation: Validated against AR lookup type YES/NO.
interest_period_days IN NUMBER No Validation: Must be entered when interest_charges is Y.
payment_grace_days IN NUMBER No Validation: Must be greater than zero.
discount_grace_days IN NUMBER No Validation: Can only be populated if the value of discount_terms is Y.
statement_cycle_id IN NUMBER No Validation:
  • Must be a valid statement_cycle_id from AR_STATEMENT_CYCLES.

  • Can be populated if send_statements is Y.

account_status IN VARCHAR2 No Validation: Validated against AR lookup type ACCOUNT_STATUS.
percent_collectable IN NUMBER No Validation: Must be between 0 and 100.
autocash_hierarchy_id IN NUMBER No Validation: Must be a valid autocash_hierarchy_id from AR_AUTOCASH_HIERARCHIES.
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  
auto_rec_incl_disputed_flag IN VARCHAR2 No Validation:
  • Cannot be set to null

  • It is a lookup code in lookup type YES/NO

tax_printing_option IN VARCHAR2 No Validation: Validated against AR lookup type TAX_PRINTING_OPTION.
charge_on_finance_charge_flag IN VARCHAR2 No Validation: It is lookup code in lookup type YES/NO.
grouping_rule_id IN NUMBER No Validation: Must be a valid grouping_rule_id from RA_GROUPING_RULES.
clearing_days IN NUMBER No Validation: Must be greater than zero.
jgzz_attribute_category IN VARCHAR2 No  
jgzz_attribute1 IN VARCHAR2 No  
jgzz_attribute2 IN VARCHAR2 No  
jgzz_attribute3 IN VARCHAR2 No  
jgzz_attribute4 IN VARCHAR2 No  
jgzz_attribute5 IN VARCHAR2 No  
jgzz_attribute6 IN VARCHAR2 No  
jgzz_attribute7 IN VARCHAR2 No  
jgzz_attribute8 IN VARCHAR2 No  
jgzz_attribute9 IN VARCHAR2 No  
jgzz_attribute10 IN VARCHAR2 No  
jgzz_attribute11 IN VARCHAR2 No  
jgzz_attribute12 IN VARCHAR2 No  
jgzz_attribute13 IN VARCHAR2 No  
jgzz_attribute14 IN VARCHAR2 No  
jgzz_attribute15 IN VARCHAR2 No  
global_attribute1 IN VARCHAR2 No  
global_attribute2 IN VARCHAR2 No  
global_attribute3 IN VARCHAR2 No  
global_attribute4 IN VARCHAR2 No  
global_attribute5 IN VARCHAR2 No  
global_attribute6 IN VARCHAR2 No  
global_attribute7 IN VARCHAR2 No  
global_attribute8 IN VARCHAR2 No  
global_attribute9 IN VARCHAR2 No  
global_attribute10 IN VARCHAR2 No  
global_attribute11 IN VARCHAR2 No  
global_attribute12 IN VARCHAR2 No  
global_attribute13 IN VARCHAR2 No  
global_attribute14 IN VARCHAR2 No  
global_attribute15 IN VARCHAR2 No  
global_attribute16 IN VARCHAR2 No  
global_attribute17 IN VARCHAR2 No  
global_attribute18 IN VARCHAR2 No  
global_attribute19 IN VARCHAR2 No  
global_attribute20 IN VARCHAR2 No  
global_attribute_category IN VARCHAR2 No  
cons_inv_flag IN VARCHAR2 No Validation: It is a lookup code in lookup type YES/NO
cons_inv_type IN VARCHAR2 No  
autocash_hierarchy_id_for_adr IN NUMBER No Validation: Must be a valid autocash_hierarchy_id from AR_AUTOCASH_HIERARCHIES.
lockbox_matching_option IN VARCHAR2 No Validation: Validated against AR lookup type ARLPLB_MATCHING_OPTION.
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 record


Comment:
  • Pass the current object_version_number of the record

  • Return new value after update

credit_classification IN VARCHAR2 No Validation: Validated against AR lookup type 'CREDIT_CLASSIFICATION'
AUTOMATCH_SET_ID IN NUMBER No  

Create Customer Profile Amount API

Description

This routine is used to create Customer Profile Amount. The API creates record in the HZ_CUST_PROFILE_AMTS table for a profile. You have to create a customer profile before you can create profile amount record.

PL/SQL Procedure

PROCEDURE create_cust_profile_amt (
    p_init_msg_list                      IN         VARCHAR2:= FND_API.G_FALSE,
    p_check_foreign_key                  IN         VARCHAR2:= FND_API.G_TRUE, 
    p_cust_profile_amt_rec               IN         CUST_PROFILE_AMT_REC_TYPE,
    x_cust_acct_profile_amt_id           OUT        NUMBER,
    x_return_status                      OUT        VARCHAR2,
    x_msg_count                          OUT        NUMBER,
    x_msg_data                           OUT        VARCHAR2
)

Note: p_check_foreign_key indicates whether to do foreign key checking for the profile amount being created. If value equals to FND_API.G_TRUE, API will do foreign key checking on cust_account_id, cust_account_profile_id and site_use_id. This was added for backward compatibility with customer form only. You should always set the parameter to FND_API.G_TRUE when you call API.

Java Method

public static void createCustProfileAmt(
    OracleConnection_connection,
    String                           p_init_msg_list,
    String                           p_check_foreign_key,
    CustProfileAmtRec                p_cust_profile_amt_rec,
    BigDecimal [ ]                   x_cust_acct_profile_amt_id,
    String [ ]                       x_return_status,
    BigDecimal [ ]                   x_msg_count,
    String [ ]                       x_msg_data
) throws SQLException;

Note: p_check_foreign_key indicates whether to do foreign key checking for the profile amount being created. If value equals to HzConstant.getGTrue(), we will do foreign key checking on cust_account_id, cust_account_profile_id and site_use_id. This was added for backward compatibility with customer form only. You should always set the parameter to HzConstant.getGTrue() when you call API.

Parameter Description and Validation

The following table lists information about the parameters in the Create Customer Profile Amount 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
cust_acct_profile_amt_id IN NUMBER Yes/No Validation: unique if passed in, else generated from sequence
cust_account_profile_id IN NUMBER Yes Validation:
  • Mandatory attribute

  • When p_check_foreign_key is FND_API.G_TRUE, cust_account_profile_id must be a foreign key to hz_customer_profiles

currency_code IN VARCHAR2 Yes Validation:
  • Mandatory attribute

  • Foreign key to fnd_currencies

  • For a given cust_account_profile_id and currency_code, only one record of the profile amount is allowed.

trx_credit_limit IN NUMBER No Validation: trx_credit_limit must be less than or equal to overall_credit_limit.
overall_credit_limit IN NUMBER No Validation: trx_credit_limit must be less than or equal to overall_credit_limit.
min_dunning_amount IN NUMBER No  
min_dunning_invoice_amount IN NUMBER No  
max_interest_charge IN NUMBER No  
min_statement_amount IN NUMBER No  
auto_rec_min_receipt_amount IN NUMBER No  
interest_rate IN NUMBER 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  
min_fc_balance_amount IN NUMBER No  
min_fc_invoice_amount IN NUMBER No  
cust_account_id IN NUMBER Yes Validation:
Mandatory attribute
When p_check_foreign_key is FND_API.G_TRUE, cust_account_id must be a foreign key to hz_cust_accounts.
When p_check_foreign_key is FND_API.G_TRUE, cust_account_id should be the same as cust_account_id in corresponding customer profile record.
site_use_id IN NUMBER No Validation:
  • When p_check_foreign_key is FND_API.G_TRUE, site_use_id must be a foreign key to hz_cust_site_uses

  • When p_check_foreign_key is FND_API.G_TRUE, site_use_id should be the same as cust_account_id in corresponding customer profile record.

expiration_date IN DATE No  
jgzz_attribute_category IN VARCHAR2 No  
jgzz_attribute1 IN VARCHAR2 No  
jgzz_attribute2 IN VARCHAR2 No  
jgzz_attribute3 IN VARCHAR2 No  
jgzz_attribute4 IN VARCHAR2 No  
jgzz_attribute5 IN VARCHAR2 No  
jgzz_attribute6 IN VARCHAR2 No  
jgzz_attribute7 IN VARCHAR2 No  
jgzz_attribute8 IN VARCHAR2 No  
jgzz_attribute9 IN VARCHAR2 No  
jgzz_attribute10 IN VARCHAR2 No  
jgzz_attribute11 IN VARCHAR2 No  
jgzz_attribute12 IN VARCHAR2 No  
jgzz_attribute13 IN VARCHAR2 No  
jgzz_attribute14 IN VARCHAR2 No  
jgzz_attribute15 IN VARCHAR2 No  
global_attribute1 IN VARCHAR2 No  
global_attribute2 IN VARCHAR2 No  
global_attribute3 IN VARCHAR2 No  
global_attribute4 IN VARCHAR2 No  
global_attribute5 IN VARCHAR2 No  
global_attribute6 IN VARCHAR2 No  
global_attribute7 IN VARCHAR2 No  
global_attribute8 IN VARCHAR2 No  
global_attribute9 IN VARCHAR2 No  
global_attribute10 IN VARCHAR2 No  
global_attribute11 IN VARCHAR2 No  
global_attribute12 IN VARCHAR2 No  
global_attribute13 IN VARCHAR2 No  
global_attribute14 IN VARCHAR2 No  
global_attribute15 IN VARCHAR2, No  
global_attribute16 IN VARCHAR2 No  
global_attribute17 IN VARCHAR2 No  
global_attribute18 IN VARCHAR2 No  
global_attribute19 IN VARCHAR2 No  
global_attribute20 IN VARCHAR2 No  
global_attribute_category 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.
p_check_foreign_key IN VARCHAR2 No Comment: Indicates whether foreign key checks will be done wherever possible.
x_cust_acct_profile_amt_id OUT NUMBER No Comment: Returns cust_acct_profile_amt_id for the record created.

Update Customer Profile Amount API

Description

This routine is used to update the Customer Profile Amount. The API updates a record in the HZ_CUST_PROFILE_AMTS table.

PL/SQL Procedure

PROCEDURE update_cust_profile_amt (

    p_init_msg_list                 IN          VARCHAR2:= FND_API.G_FALSE,
    p_cust_profile_amt_rec          IN          CUST_PROFILE_AMT_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 updateCustProfileAmt(
    OracleConnection_connection,
    String                           p_init_msg_list,
    CustProfileAmtRec                p_cust_profile_amt_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 Customer Profile Amount 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
cust_acct_profile_amt_id IN NUMBER Yes Validation: Valid cust_acct_profile_amt_id value must be passed in
Comment: Pass cust_acct_profile_amt_id from hz_cust_profile_amts
cust_account_profile_id IN NUMBER No Validation: Not updateable
currency_code IN VARCHAR2 No Validation: Not updateable
trx_credit_limit IN NUMBER No Validation: trx_credit_limit must be less than or equal to overall_credit_limit.
overall_credit_limit IN NUMBER No Validation: trx_credit_limit must be less than or equal to overall_credit_limit.
min_dunning_amount IN NUMBER No  
min_dunning_invoice_amount IN NUMBER No  
max_interest_charge IN NUMBER No  
min_statement_amount IN NUMBER No  
auto_rec_min_receipt_amount IN NUMBER No  
interest_rate IN NUMBER 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  
min_fc_balance_amount IN NUMBER No  
min_fc_invoice_amount IN NUMBER No  
cust_account_id IN NUMBER No Validation: Not updateable
site_use_id IN NUMBER No Validation: Not updateable
expiration_date IN DATE No  
jgzz_attribute_category IN VARCHAR2 No  
jgzz_attribute1 IN VARCHAR2 No  
jgzz_attribute2 IN VARCHAR2 No  
jgzz_attribute3 IN VARCHAR2 No  
jgzz_attribute4 IN VARCHAR2 No  
jgzz_attribute5 IN VARCHAR2 No  
jgzz_attribute6 IN VARCHAR2 No  
jgzz_attribute7 IN VARCHAR2 No  
jgzz_attribute8 IN VARCHAR2 No  
jgzz_attribute9 IN VARCHAR2 No  
jgzz_attribute10 IN VARCHAR2 No  
jgzz_attribute11 IN VARCHAR2 No  
jgzz_attribute12 IN VARCHAR2 No  
jgzz_attribute13 IN VARCHAR2 No  
jgzz_attribute14 IN VARCHAR2 No  
jgzz_attribute15 IN VARCHAR2 No  
global_attribute1 IN VARCHAR2 No  
global_attribute2 IN VARCHAR2 No  
global_attribute3 IN VARCHAR2 No  
global_attribute4 IN VARCHAR2 No  
global_attribute5 IN VARCHAR2 No  
global_attribute6 IN VARCHAR2 No  
global_attribute7 IN VARCHAR2 No  
global_attribute8 IN VARCHAR2 No  
global_attribute9 IN VARCHAR2 No  
global_attribute10 IN VARCHAR2 No  
global_attribute11 IN VARCHAR2 No  
global_attribute12 IN VARCHAR2 No  
global_attribute13 IN VARCHAR2 No  
global_attribute14 IN VARCHAR2 No  
global_attribute15 IN VARCHAR2 No  
global_attribute16 IN VARCHAR2 No  
global_attribute17 IN VARCHAR2 No  
global_attribute18 IN VARCHAR2 No  
global_attribute19 IN VARCHAR2 No  
global_attribute20 IN VARCHAR2 No  
global_attribute_category 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: Cannot be updated if value exists
p_object_version_number IN
OUT
NUMBER Yes Validation:
  • Mandatory attribute

  • Validated against value in the database for the existing record


Comment:
  • Pass current object_version_number of the record from hz_cust_profile_amts table

  • Return new value after update

Customer Account Role APIs

PL/SQL Package Name: HZ_CUST_ACCOUNT_ROLE_V2PUB

Java Class Name: HzCustAccountRoleV2Pub

PL/SQL Record Structure for Customer Account Role

TYPE cust_account_role_rec_type          IS RECORD (
    cust_account_role_id                 NUMBER,
    party_id                             NUMBER,
    cust_account_id                      NUMBER,
    cust_acct_site_id                    NUMBER,
    primary_flag                         VARCHAR2(1),
    role_type                            VARCHAR2(30),
    source_code                          VARCHAR2(150),
    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),
    orig_system_reference                VARCHAR2(240),
    orig_system                          VARCHAR2(30),
    attribute25                          VARCHAR2(150),
    status                               VARCHAR2(1),
    created_by_module                    VARCHAR2(150),
    application_id                       NUMBER
)

PL/SQL Record Structure for Role Responsibility

TYPE role_responsibility_rec_type   IS RECORD (
    responsibility_id               NUMBER,
    cust_account_role_id            NUMBER,
    responsibility_type             VARCHAR2(30),
    primary_flag                    VARCHAR2(1),
    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),
    orig_system_reference           VARCHAR2(240),
    created_by_module               VARCHAR2(150),
    application_id                  NUMBER
)

Java Inner Class for Customer Account Role

public static class CustAccountRoleRec {
    public BigDecimal                   cust_account_role_id;
    public BigDecimal                   party_id;
    public BigDecimal                   cust_account_id;
    public BigDecimal                   cust_acct_site_id;
    public String                       primary_flag;
    public String                       role_type;
    public String                       source_code;
    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                       orig_system_reference;
    public String                       orig_system;
    public String                       attribute25;
    public String                       status;
    public String                       created_by_module;
    public BigDecimal                   application_id;

    public CustAccountRoleRec();
    public CustAccountRoleRec(boolean __RosettaUseGMISSValues);
}

Java Inner Class for Role Responsibility

public static class RoleResponsibilityRec {
    public BigDecimal               responsibility_id;
    public BigDecimal               cust_account_role_id;
    public String                   responsibility_type;
    public String                   primary_flag;
    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                   orig_system_reference;
    public String                   orig_system;
    public String                   created_by_module;
    public BigDecimal               application_id;

    public RoleResponsibilityRec();
    public RoleResponsibilityRec(boolean __RosettaUseGMISSValues);
}

Create Customer Account Role API

Description

This routine is used to create an Account Role. The API creates a record in the HZ_CUST_ACCOUNT_ROLES table. To create a customer account role, you must have already created a customer account and an org contact for the party owning the customer account. If an orig_system_reference is passed in, the API creates a record in the HZ_ORIG_SYS_REFERENCES table to store the mapping between the source system reference and the TCA primary key. If orig_system_reference is not passed in, the default is UNKNOWN.

PL/SQL Procedure

PROCEDURE create_cust_account_role (
    p_init_msg_list                  IN        VARCHAR2:= FND_API.G_FALSE,
    p_cust_account_role_rec          IN        CUST_ACCOUNT_ROLE_REC_TYPE,
    x_cust_account_role_id           OUT       NUMBER,
    x_return_status                  OUT       VARCHAR2,
    x_msg_count                      OUT       NUMBER,
    x_msg_data                       OUT       VARCHAR2
)

Java Method

public static void createCustAccountRole(
  OracleConnection_connection,
    String                          p_init_msg_list,
    CustAccountRoleRec              p_cust_account_role_rec,
    BigDecimal [ ]                  x_cust_account_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 Customer Account 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
cust_account_role_id IN NUMBER Yes Validation: Unique if passed in, else generated from sequence
party_id IN NUMBER Yes Validation:
  • Mandatory attribute

  • Foreign key to hz_parties

cust_account_id IN NUMBER Yes Validation:
  • Mandatory field

  • Foreign key to hz_cust_accounts

cust_acct_site_id IN NUMBER No Validation:
  • Foreign key to hz_cust_acct_sites

  • The cust_account_id in hz_cust_acct_sites which cust_acct_site_id points to should be same as the cust_account_id put in the hz_cust_account_roles

primary_flag IN VARCHAR2 No Validation:
  • Primary flag is lookup code in lookup type YES/NO

  • It is unique per cust_account_id or cust_acct_site_id


Default: N
role_type IN VARCHAR2 Y Validation:
  • Mandatory attribute

  • It is a lookup code in lookup type ACCT_ROLE_TYPE²

  • The combination of CUST_ACCOUNT_ID, PARTY_ID, ROLE_TYPE should be unique.I.

  • Or the combination of CUST_ACCT_SITE_ID, PARTY_ID, ROLE_TYPE should be unique

source_code 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  
orig_system_reference IN VARCHAR2 Yes 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.
Default: cust_account_role_id
orig_system IN VARCHAR2 Yes Validation: Foreign key to HZ_ORIG_SYSTEMS_B.orig_system.
Default: UNKNOWN if an orig_system_reference is passed in.
attribute25 IN VARCHAR2 No  
status IN VARCHAR2 Yes Validation: It is a lookup code in 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_cust_account_role_id OUT NUMBER No Comment: Returns cust_account_role_id for the record created

Other Validations

When creating cust account role in cust account site level, if the contact referenced by party_id does not have party site in the same location as this cust account site, API creates a party site for the contact.

Update Customer Account Role API

Description

This routine is used to update an Account Role. The API updates a record in the HZ_CUST_ACCOUNT_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_cust_account_role (
    p_init_msg_list                 IN         VARCHAR2:= FND_API.G_FALSE,
    p_cust_account_role_rec         IN         CUST_ACCOUNT_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 updateCustAccountRole(
    OracleConnection_connection,
    String                          p_init_msg_list,
    CustAccountRoleRec              p_cust_account_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 Customer Account 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
cust_account_role_id IN NUMBER Yes Validation: Valid cust_account_role_id should be passed in
Comment: Pass cust_account_role_id from hz_cust_account_roles table
party_id IN NUMBER Yes Validation: Not updateable
cust_account_id IN NUMBER Yes Validation: Not updateable
cust_acct_site_id IN NUMBER No Validation: Not updateable
primary_flag IN VARCHAR2 No Validation: Primary flag is lookup code in lookup type YES/NO
role_type IN VARCHAR2 Yes Validation: Not updateable
source_code 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  
orig_system_reference IN VARCHAR2 Yes Validation: Not updateable
orig_system IN VARCHAR2 Yes Validation: Foreign key to HZ_ORIG_SYSTEMS_B.orig_system.
attribute25 IN VARCHAR2 No  
status IN VARCHAR2 Yes Validation:
  • Status cannot be set to null during update

  • It is a lookup code in lookup type REGISTRY_STATUS

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

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


Comment:
  • Pass current object_version_number of the record from hz_custaccount_roles

  • Returns new value after update

Create Role Responsibility API

Description

This routine is used to create a Role Responsibility. The API creates a record in the HZ_ROLE_RESPONSIBILITY table.

PL/SQL Procedure

PROCEDURE create_role_responsibility (
    p_init_msg_list                 IN         VARCHAR2:= FND_API.G_FALSE,
    p_role_responsibility_rec       IN         ROLE_RESPONSIBILITY_REC_TYPE,
    x_responsibility_id             OUT        NUMBER,
    x_return_status                 OUT        VARCHAR2,
    x_msg_count                     OUT        NUMBER,
    x_msg_data                      OUT        VARCHAR2
)

Java Method

public static void createRoleResponsibility(
   OracleConnection_connection,
    String                            p_init_msg_list,
    RoleResponsibilityRec             p_role_responsibility_rec,
    BigDecimal [ ]                    x_responsibility_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 Role Responsibility 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
responsibility_id IN NUMBER Yes/No Validation: unique if passed in, else generated from sequence
cust_account_role_id IN NUMBER Yes Validation:
  • Mandatory field

  • Foreign key to hz_cust_account_roles

responsibility_type IN VARCHAR2 Yes Validation:
  • Mandatory field

  • It is a lookup code in lookup type SITE_USE_CODE

primary_flag IN VARCHAR2 No Validation:
  • Primary Flag is lookup code in lookup type YES/NO.

  • It is unique per cust_account_role_id Default: N

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  
orig_system_reference IN VARCHAR2 No Default: responsibility_id
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_responsibility_id OUT NUMBER No Comment: Returns responsibility_id for the record created

Other Validations

The combination of cust_account_role_id and responsibility_type should be unique.

Update Role Responsibility API

Description

This routine is used to update a Role Responsibility. The API updates a record in the HZ_ROLE_RESPONSIBILITY table.

PL/SQL Procedure

PROCEDURE update_role_responsibility (
    p_init_msg_list                      IN        VARCHAR2:= FND_API.G_FALSE,
    p_role_responsibility_rec            IN        ROLE_RESPONSIBILITY_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 updateRoleResponsibility(
  OracleConnection_connection,
    String                            p_init_msg_list,
    RoleResponsibilityRec             p_role_responsibility_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 Role Responsibility 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
responsibility_id IN NUMBER Yes Validation: Valid responsibility_id should be passed in
Comment: Pass responsibility_id from the hz_role_responsibility table
cust_account_role_id IN NUMBER No Validation: Non updateable
responsibility_type IN VARCHAR2 No Validation: Non updateable
primary_flag IN VARCHAR2 No Validation:
  • Primary Flag is lookup code in lookup type YES/NO

  • It is unique per cust_account_role_id

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  
orig_system_reference IN VARCHAR2 No Validation: Not updateable
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: Cannot be updated if value exists
p_object_version_number IN OUT NUMBER Yes Validation:
  • Mandatory attribute

  • Validated against value in the database for the existing record


Comment:
  • Pass current object_version_number of the record from hz_role_responsibility²

  • Return new value after update

Other Validations

The combination of cust_account_role_id and responsibility_type should be unique.