Beruflich Dokumente
Kultur Dokumente
Note- Columns values are assigned to record type variable from various Cursor Staging Tables
Below API creates record for Party organization, customer account and customer profile all in one
HZ_CUST_ACCOUNT_V2PUB.create_cust_account
(
p_init_msg_list =>FND_API.G_FALSE,
p_cust_account_rec => v_customer_account_rec, -- Customer Account Record
p_organization_rec => v_organization_rec, -- Party Organization Record
p_customer_profile_rec => v_customer_profile_rec, -- Customer Profile Record
p_create_profile_amt => FND_API.G_FALSE,
x_cust_account_id => v_customer_account_id,
x_account_number => v_customer_account_number,
x_party_id => v_party_id,
x_party_number => v_party_number,
x_profile_id => v_profile_id,
x_return_status =>v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
HZ_CUSTOMER_PROFILE_V2PUB.create_cust_profile_amt
(
p_init_msg_list => 'T' ,
p_check_foreign_key => FND_API.G_TRUE,
p_cust_profile_amt_rec => v_customer_profile_amt,
x_cust_acct_profile_amt_id => v_cust_act_prof_amt_id,
x_return_status =>v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
HZ_LOCATION_V2PUB.create_location
(
p_init_msg_list => 'T',
p_location_rec => v_location_rec,
x_location_id => v_location_id,
x_return_status => v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
HZ_PARTY_SITE_V2PUB.create_party_site
(
p_init_msg_list => 'T',
p_party_site_rec => v_party_site_rec,
x_party_site_id => v_party_site_id,
x_party_site_number => v_party_site_no,
x_return_status => v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
HZ_CONTACT_POINT_V2PUB.create_contact_point
(
p_init_msg_list => 'T',
p_contact_point_rec => v_contact_point_rec,
p_phone_rec => v_phone_rec,
x_contact_point_id => v_contact_point_party_id,
x_return_status => v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
v_org_contact_rec.created_by_module := 'TCA_V1_API';
v_org_contact_rec.job_title := rec_contacts.job_title;
v_org_contact_rec.party_rel_rec.subject_id := v_person_party_id ;
v_org_contact_rec.party_rel_rec.subject_type := 'PERSON';
v_org_contact_rec.party_rel_rec.subject_table_name := 'HZ_PARTIES';
v_org_contact_rec.party_rel_rec.object_id := v_party_id ;
v_org_contact_rec.party_rel_rec.object_type := 'ORGANIZATION';
v_org_contact_rec.party_rel_rec.object_table_name := 'HZ_PARTIES';
v_org_contact_rec.party_rel_rec.relationship_code := 'CONTACT_OF';
v_org_contact_rec.party_rel_rec.relationship_type := 'CONTACT';
v_org_contact_rec.party_rel_rec.start_date := SYSDATE;
HZ_PARTY_CONTACT_V2PUB.create_org_contact
(
p_init_msg_list => 'T',
p_org_contact_rec => v_org_contact_rec,
x_org_contact_id => v_org_contact_id,
x_party_rel_id => v_party_rel_id,
x_party_id => v_party_contact_id,
x_party_number => v_party_rel_number,
x_return_status => v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
v_party_site_use_rec.site_use_type := rec_customer_sites_staging.site_use_code;
v_party_site_use_rec.party_site_id := v_party_site_id;
v_party_site_use_rec.primary_per_type := rec_customer_sites_staging.primary_flag;
v_party_site_use_rec.status := rec_customer_sites_staging.status;
v_party_site_use_rec.created_by_module := 'TCA_V1_API';
HZ_PARTY_SITE_V2PUB.create_party_site_use
(
p_init_msg_list => 'T',
p_party_site_use_rec => v_party_site_use_rec,
x_party_site_use_id => v_party_site_use_id ,
x_return_status => v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_acct_site
(
p_init_msg_list => 'T',
p_cust_acct_site_rec=> v_cust_acct_site_rec,
x_cust_acct_site_id => v_cust_acct_site_id,
x_return_status => v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use
(
p_init_msg_list => 'T',
p_cust_site_use_rec => v_customer_site_use_rec,
p_customer_profile_rec => v_customer_profile_rec,
p_create_profile => FND_API.G_FALSE,
p_create_profile_amt => FND_API.G_FALSE,
x_site_use_id => v_site_use_id,
x_return_status => v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
v_customer_profile_amt := NULL;
v_customer_profile_amt.cust_account_profile_id := v_cust_account_profile_id;
v_customer_profile_amt.cust_account_id := v_customer_account_id;
v_customer_profile_amt.currency_code := rec_cust_prof_amt_stage_sites.currency_code;
v_customer_profile_amt.trx_credit_limit := rec_cust_prof_amt_stage_sites.trx_credit_limit;
v_customer_profile_amt.overall_credit_limit := rec_cust_prof_amt_stage_sites.overall_credit_limit;
v_customer_profile_amt.min_dunning_amount := rec_cust_prof_amt_stage_sites.min_dunning_amount;
v_customer_profile_amt.min_statement_amount := rec_cust_prof_amt_stage_sites.min_statement_amount;
v_customer_profile_amt.site_use_id := v_site_use_id;
v_customer_profile_amt.created_by_module := 'TCA_V1_API';
HZ_CUSTOMER_PROFILE_V2PUB.create_cust_profile_amt
(
p_init_msg_list => 'T' ,
p_check_foreign_key => FND_API.G_TRUE,
p_cust_profile_amt_rec => v_customer_profile_amt,
x_cust_acct_profile_amt_id => v_cust_act_prof_amt_id,
x_return_status =>v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data
);
-- If you want to Create Organization separately in some other program, use below API for reference
HZ_PARTY_V2PUB.create_organization
(
p_init_msg_list => 'T',
p_organization_rec => v_organization_rec,
x_return_status => v_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data,
x_party_id => v_party_id,
x_party_number => v_party_number,
x_profile_id => v_profile_id
);