Download - SCM_Presentation3_TechArchOfCustomer
CustomerManufacturer
Supplier
Retailer Production Facility
Distributor
Customer
A party is an entity that can enter into business and can be of the type Organization or Person. A customer account represents the business relationship that a party can enter in to with another party. The account has information about the terms and conditions of doing business with the party. For example, you could open a commercial account for purchases to be made by Vision Distribution for its internal use and a reseller account for purchases made by Vision Distribution for sales of your products to end-users .
You can also maintain multiple customer accounts for a customer that transacts business with more than one line of business in your organization. You maintain separate customer profiles, addresses, and contacts for each customer account.A party site is the location where a particular party is physically located. Every party has only one identifying address, but a party can have multiple party sites.A customer address is a party site used in the context of a customer account for billing, shipping, or other purposes.A contact communicates for or acts on behalf of a party or customer account. A contact can exist for a customer at the account or address level. A person usually acts as a contact for an organization, but can also be a contact for another person. For example, an administrative assistant could be the contact for an executive.
You can also define contact people, bank accounts, payment methods, telephone numbers, and relationships for each customer account.
We can create a new party and customer or add a new customer to an existing party. Let’s see how to create a customer account for an existing Party..We need to create a customer for an existing Party. So search for an existing Customer and open the Party record which doesn’t have a customer number associated with it
We get the Party information here and now enter a different Account name for the new customer belonging to this party. Then create a new address and site use or this new customer.
Now search for party AT % and we will see the new customer Account ‘ATT Videos’.
After entering the A/c name and address save it. We will have a new customer number 4093 for the ‘AT & T Universal Card’ Party.
Enter Standard Industry Classification (SIC) code ,Tax Calculation ie. If your Tax Method is VAT , choose a tax calculation level. Choose ’Line’ to calculate VAT for each invoice line. Choose ’Header’ to calculate VAT once for each invoice for each rate, tax code to assign to this customer. You can select any active tax code except those of type ’Location Based Tax’,taxpayer registration number ie.VAT number. (Oracle Receivables prints this number on your customer’s invoices), Tax Rounding, The type of customer you are entering. Internal is used to track customer accounts within your company while External is used to track customer accounts outside your company.
In Order Management Fields enter Order Type,Price List,FOB (free on board) ie. The point or location where the ownership title of goods is transferred from the seller to the buyer,Freight Terms ie. whether the customer is responsible for the freight charges for an order, GSA Indicator: Indicates whether this customer is a government agency ,Over Return Tolerance, Over Shipment Tolerance, Sales Channel, Ship Method, Warehouse
HZ_PARTIES
PARTY_ID
PARTY_NUMBER
PARTY_NAME
PARTY_TYPE
VALIDATED_FLAG
ORIG_SYSTEM_REFERENCE
SIC_CODE
HQ_BRANCH_IND
CUSTOMER_KEY
TAX_REFERENCE
JGZZ_FISCAL_CODE
DUNS_NUMBER
TAX_NAME …….
HZ_CUST_ACCOUNTS
CUST_ACCOUNT_ID
PARTY_ID
ACCOUNT_NUMBER
ORIG_SYSTEM_REFERENCE
STATUS
CUSTOMER_TYPE
CUSTOMER_CLASS_CODE
PRIMARY_SALESREP_ID
SALES_CHANNEL_CODE
ORDER_TYPE_ID
PRICE_LIST_ID
SUBCATEGORY_CODE
TAX_CODE
FOB_POINT
FREIGHT_TERM
SHIP_PARTIAL
SHIP_VIA
WAREHOUSE_ID
PAYMENT_TERM_ID
TAX_HEADER_LEVEL_FLAG
TAX_ROUNDING_RULE
CURRENT_BALANCE
ACCOUNT_ACTIVATION_DATE
CREDIT_CLASSIFICATION_CODE
DEPARTMENT
MAJOR_ACCOUNT_NUMBER
HIGH_PRIORITY_REMARKS
PO_EFFECTIVE_DATE
PO_EXPIRATION_DATE
REALTIME_RATE_FLAG
SINGLE_USER_FLAG ….
HZ_ORGANIZATION_PROFILES
ORGANIZATION_PROFILE_ID
PARTY_ID
ORGANIZATION_NAME
DUNS_NUMBER
ENQUIRY_DUNS
CEO_NAME
CEO_TITLE
PRINCIPAL_NAME
PRINCIPAL_TITLE
LEGAL_STATUS
CONTROL_YR
EMPLOYEES_TOTAL
HQ_BRANCH_IND
BRANCH_FLAG
OOB_IND
LINE_OF_BUSINESS …….
Use the Communications tabbed region to define contact points to customers. You can use these contact points to initiate communications to customers. Telephone numbers, mobile phone numbers, and email addresses are examples of contact points.
In Marketing Tab, Enter statistical information such as number of employees and year established,ending month for the analysis year , revenue for the current year and projected revenue for the next year,customer’s mission statement.
Use the Contacts tabbed region to enter information about people who receive communications for a customer account. Enter the contact details, including last and first name, title, job, mail stop, reference, and email.Enter the contact point information in the Communication region.
Use the Contacts Roles tabbed region to define roles for your contacts, such as Bill-to, Ship-to, Statements, or Marketing.
HZ_CONTACT_POINTS
CONTACT_POINT_ID
CONTACT_POINT_TYPE eg.. EMAIL, WEB, PHONE
STATUS
OWNER_TABLE_NAME eg.. HZ_PARTIES ,HZ_PARTY_SITES
OWNER_TABLE_ID ie.. ID of the above Table
PRIMARY_FLAG
ORIG_SYSTEM_REFERENCE
EDI_TRANSACTION_HANDLING
EDI_ID_NUMBER
EDI_PAYMENT_METHOD
EDI_PAYMENT_FORMAT
EDI_REMITTANCE_METHOD
EDI_REMITTANCE_INSTRUCTION
EDI_TP_HEADER_ID
EDI_ECE_TP_LOCATION_CODE
EMAIL_FORMAT
EMAIL_ADDRESS
BEST_TIME_TO_CONTACT_START
BEST_TIME_TO_CONTACT_END
PHONE_CALLING_CALENDAR
CONTACT_ATTEMPTS
CONTACTS
DECLARED_BUSINESS_PHONE_FLAG
DO_NOT_USE_FLAG
DO_NOT_USE_REASON
LAST_CONTACT_DT_TIME
PHONE_PREFERRED_ORDER
PRIORITY_OF_USE_CODE
HZ_CUST_ACCOUNT_ROLES
CUST_ACCOUNT_ROLE_ID
PARTY_ID
CUST_ACCOUNT_ID
CUST_ACCT_SITE_ID
ROLE_TYPE eg. CONTACT , GUARANTOR
CURRENT_ROLE_STATE
CURRENT_ROLE_STATE_EFFECTIVE
BEGIN_DATE
END_DATE
PRIMARY_FLAG
SOURCE_CODE
ORIG_SYSTEM_REFERENCE
STATUS
OBJECT_VERSION_NUMBER
CREATED_BY_MODULE
APPLICATION_ID
HZ_ROLE_RESPONSIBILITY
RESPONSIBILITY_ID
CUST_ACCOUNT_ROLE_ID
RESPONSIBILITY_TYPE eg. BILL-TO, DUN
PRIMARY_FLAG
ORIG_SYSTEM_REFERENCE
OBJECT_VERSION_NUMBER
CREATED_BY_MODULE
APPLICATION_ID
Gasper Danielle is the Party_id here for ‘Hilman and
Associates’ Cust_Account_id
AP_BANK_ACCOUNTS_ALL
BANK_ACCOUNT_ID
BANK_BRANCH_ID
BANK_ACCOUNT_NAME
BANK_ACCOUNT_NUM
SET_OF_BOOKS_ID
CURRENCY_CODE
DESCRIPTION
CONTACT_FIRST_NAME
CONTACT_MIDDLE_NAME
CONTACT_LAST_NAME
CONTACT_PREFIX
CONTACT_TITLE
CONTACT_AREA_CODE
CONTACT_PHONE
MAX_CHECK_AMOUNT
MIN_CHECK_AMOUNT
AP_BANK_BRANCHES
BANK_BRANCH_ID
BANK_NAME
BANK_BRANCH_NAME
DESCRIPTION
ADDRESS_LINE1
ADDRESS_LINE2
ADDRESS_LINE3
CITY
STATE
ZIP
PROVINCE
COUNTRY
AREA_CODE
PHONE
CONTACT_FIRST_NAME
CONTACT_LAST_NAME
CONTACT_PREFIX
AP_BANK_ACCOUNT_USES_ALL
BANK_ACCOUNT_USES_ID
CUSTOMER_ID
CUSTOMER_SITE_USE_ID
VENDOR_ID
VENDOR_SITE_ID
EXTERNAL_BANK_ACCOUNT_ID
START_DATE
END_DATE
PRIMARY_FLAG
ORG_ID
OWNING_PARTY_ID
Assign bank accounts to customer accounts to allow funds to be automatically transferred from these accounts to your remittance bank accounts when using Automatic Receipts.
You can assign manual payment methods to your customer accounts to indicate which form of payment will be used to pay that customer’s transactions, such as a check or wire transfer
Define relationships between customer accounts to control payment and commitment application. You can create relationships between any customer accounts and indicate that the relationship is either one-way or reciprocal. You must also indicate if the relationship is a bill-to or ship-to relationship, or both.
Use Customer Profiles to group customer accounts with similar credit worthiness, business volume, and payment cycles. For each profile class you can define information such as credit limits, payment terms, statement cycles, invoicing, and discount information. You can also define amount limits for your finance charges, dunning, and statements for each currency in which you do business.
In Order Management, related customers share agreements, commitments, invoice-to and ship-to addresses, and contacts.Reciprocal account relationships allow parties to pay each other’s debit items and enter invoices against each other’s commitments.
HZ_CUST_ACCT_RELATE_ALL
CUST_ACCOUNT_ID
RELATED_CUST_ACCOUNT_ID
RELATIONSHIP_TYPE
COMMENTS
CUSTOMER_RECIPROCAL_FLAG
STATUS
ORG_ID
BILL_TO_FLAG
SHIP_TO_FLAG
OBJECT_VERSION_NUMBER
CREATED_BY_MODULE
APPLICATION_ID
HZ_CUST_PROFILE_AMTS
CUST_ACCT_PROFILE_AMT_ID
CUST_ACCOUNT_PROFILE_ID
CURRENCY_CODE
TRX_CREDIT_LIMIT
OVERALL_CREDIT_LIMIT
MIN_DUNNING_AMOUNT
MIN_DUNNING_INVOICE_AMOUNT
MAX_INTEREST_CHARGE
MIN_STATEMENT_AMOUNT
AUTO_REC_MIN_RECEIPT_AMOUNT
INTEREST_RATE
MIN_FC_BALANCE_AMOUNT
MIN_FC_INVOICE_AMOUNT
CUST_ACCOUNT_ID
SITE_USE_ID
EXPIRATION_DATE
OBJECT_VERSION_NUMBER
HZ_CUSTOMER_PROFILES
CUST_ACCOUNT_PROFILE_ID
CUST_ACCOUNT_ID
SITE_USE_ID
PROFILE_CLASS_ID
STATUS
COLLECTOR_ID
CREDIT_ANALYST_ID
CREDIT_CHECKING
NEXT_CREDIT_REVIEW_DATE
TOLERANCE
DISCOUNT_TERMS
DUNNING_LETTERS
INTEREST_CHARGES
PREF_FUNCTIONAL_CURRENCY
SEND_STATEMENTS
CREDIT_BALANCE_STATEMENTS
CREDIT_HOLD
CREDIT_RATING
RISK_CODE
STANDARD_TERMS
OVERRIDE_TERMS
DUNNING_LETTER_SET_ID
INTEREST_PERIOD_DAYS
PAYMENT_GRACE_DAYS
DISCOUNT_GRACE_DAYS
STATEMENT_CYCLE_ID
Enter, add, change, or deactivate address information for party and customer accounts. You can enter multiple addresses for each of your customer accounts and specify one or more business purposes for each address (such as Ship-to, Bill-to, or Statements). You can validate your addresses using flexible address formats or the address validation system option. If your tax method is Sales Tax, Oracle Receivables uses validated customer account address information to determine tax liability on your customer’s transactions.
HZ_PARTY_SITES
PARTY_SITE_ID
PARTY_ID
LOCATION_ID
PARTY_SITE_NUMBER
ORIG_SYSTEM_REFERENCE
START_DATE_ACTIVE
REGION
MAILSTOP
CUSTOMER_KEY_OSM
IDENTIFYING_ADDRESS_FLAG HZ_LOCATIONS
LOCATION_ID
ORIG_SYSTEM_REFERENCE
COUNTRY
ADDRESS1
ADDRESS2
ADDRESS3
ADDRESS4
CITY
POSTAL_CODE
STATE
PROVINCE
COUNTY
HZ_CUST_SITE_USES_ALL
SITE_USE_ID
CUST_ACCT_SITE_ID
SITE_USE_CODE
PRIMARY_FLAG
STATUS
LOCATION
CONTACT_ID
BILL_TO_SITE_USE_ID
ORIG_SYSTEM_REFERENCE
SIC_CODE
PAYMENT_TERM_ID
GSA_INDICATOR
SHIP_PARTIAL
SHIP_VIA
FOB_POINT
ORDER_TYPE_ID
PRICE_LIST_ID
FREIGHT_TERM
WAREHOUSE_ID
TERRITORY_ID
TAX_CODE
HZ_ORG_CONTACTS
ORG_CONTACT_ID
PARTY_SITE_ID
PARTY_RELATIONSHIP_ID
TITLE
JOB_TITLE
MAIL_STOP
CONTACT_KEY
COMMENTS
CONTACT_NUMBER
DEPARTMENT_CODE
DEPARTMENT
DECISION_MAKER_FLAG
JOB_TITLE_CODE
MANAGED_BY
REFERENCE_USE_FLAG
RANK
ORIG_SYSTEM_REFERENCE
NATIVE_LANGUAGE
OTHER_LANGUAGE_1
OTHER_LANGUAGE_2
MAILING_ADDRESS_ID
MATCH_GROUP_ID
STATUS
OBJECT_VERSION_NUMBER
CREATED_BY_MODULE
APPLICATION_ID
HZ_ORG_CONTACT_ROLES
ORG_CONTACT_ROLE_ID
ORG_CONTACT_ID
ROLE_TYPE
CREATED_BY
ROLE_LEVEL
PRIMARY_FLAG
CREATION_DATE
ORIG_SYSTEM_REFERENCE
PRIMARY_CONTACT_PER_ROLE_TYPE
STATUS
OBJECT_VERSION_NUMBER
CREATED_BY_MODULE
APPLICATION_ID
You can enter telephone numbers for a specific address or for a specific customer account contact.
HZ_RELATIONSHIPS
RELATIONSHIP_ID
RELATIONSHIP_TYPE eg.. CONTACT, PARTNER
SUBJECT_ID
SUBJECT_TYPE
SUBJECT_TABLE_NAME eg.. HZ_PARTIES
OBJECT_ID
OBJECT_TYPE
OBJECT_TABLE_NAME eg.. HZ_PARTIES
PARTY_ID
RELATIONSHIP_CODE
DIRECTIONAL_FLAG
COMMENTS
START_DATE
END_DATE
STATUS
CONTENT_SOURCE_TYPE
OBJECT_VERSION_NUMBER
When u created Customer Contacts or Org Contacts, a relation ship record was created here.
Create an OrganizationDECLAREp_organization_rec HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE;x_return_status VARCHAR2(2000);x_msg_count NUMBER;x_msg_data VARCHAR2(2000);x_party_id NUMBER;x_party_number VARCHAR2(2000);x_profile_id NUMBER;BEGINp_organization_rec.organization_name := ’ABC Corporation’;p_organization_rec.created_by_module := ’TCA_EXAMPLE’;hz_party_v2pub.create_organization (’T’,p_organization_rec,x_return_status,x_msg_count,x_msg_data,x_party_id,x_party_number,x_profile_id);dbms_output.put_line(SubStr(’x_return_status = ’||x_return_status,1,255));dbms_output.put_line(’x_msg_count = ’||TO_CHAR(x_msg_count));dbms_output.put_line(SubStr(’x_msg_data = ’||x_msg_data,1,255));IF x_msg_count >1 THENFOR I IN 1..x_msg_countLOOPdbms_output.put_line(I||’. ’||SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));END LOOP;END IF;END;
Similarly you can call hz_party_v2pub.create_person to create record in the HZ_PARTIES and HZ_PERSON_PROFILES tables & hz_party_v2pub.create_group to create record in the HZ_PARTIES table.
Create a LocationDECLAREp_location_rec HZ_LOCATION_V2PUB.LOCATION_REC_TYPE;x_location_id NUMBER;x_return_status VARCHAR2(2000);x_msg_count NUMBER;x_msg_data VARCHAR2(2000);BEGINp_location_rec.country := ’US’;p_location_rec.address1 := ’300 Oracle Parkway’;p_location_rec.address2 := ’13th Floor’;p_location_rec.city := ’Redwood Shores’;p_location_rec.postal_code := ’94065’;p_location_rec.state := ’CA’;p_location_rec.created_by_module := ’TCA_EXAMPLE’;hz_location_v2pub.create_location(’T’,p_location_rec,x_location_id,x_return_status,x_msg_count,x_msg_data);dbms_output.put_line(SubStr(’x_return_status = ’||x_return_status,1,255));dbms_output.put_line(’x_msg_count = ’||TO_CHAR(x_msg_count));dbms_output.put_line(SubStr(’x_msg_data = ’||x_msg_data,1,255));IF x_msg_count >1 THENFOR I IN 1..x_msg_countLOOPdbms_output.put_line(I||’. ’||SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));END LOOP;END IF;END
Create a Party SiteThe following examples use the organizations and locations created in the previousexamples.DECLAREp_party_site_rec HZ_PARTY_SITE_V2PUB.PARTY_SITE_REC_TYPE;x_party_site_id NUMBER;x_party_site_number VARCHAR2(2000);x_return_status VARCHAR2(2000);x_msg_count NUMBER;x_msg_data VARCHAR2(2000);BEGINp_party_site_rec.party_id := 1272023;p_party_site_rec.location_id := 359086;p_party_site_rec.identifying_address_flag := ’Y’;p_party_site_rec.created_by_module := ’TCA_EXAMPLE’;hz_party_site_v2pub.create_party_site(’T’,p_party_site_rec,x_party_site_id,x_party_site_number,x_return_status,x_msg_count,x_msg_data);dbms_output.put_line(SubStr(’x_return_status = ’||x_return_status,1,255));dbms_output.put_line(’x_msg_count = ’||TO_CHAR(x_msg_count));dbms_output.put_line(SubStr(’x_msg_data = ’||x_msg_data,1,255));IF x_msg_count >1 THENFOR I IN 1..x_msg_countLOOPdbms_output.put_line(I||’. ’||SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));END LOOP;END IF;END;
Select Statement to Check Dataselect party_site_id, party_id, location_id, party_site_numberfrom hz_party_siteswhere party_site_id = 349327;
Create a Party Site UseDECLAREp_party_site_use_rec HZ_PARTY_SITE_V2PUB.PARTY_SITE_USE_REC_TYPE;x_party_site_use_id NUMBER;x_return_status VARCHAR2(2000);x_msg_count NUMBER;x_msg_data VARCHAR2(2000);BEGINp_party_site_use_rec.site_use_type := ’SHIP_TO’;p_party_site_use_rec.party_site_id := 349327;p_party_site_use_rec.created_by_module := ’TCA_EXAMPLE’;hz_party_site_v2pub.create_party_site_use(’T’,p_party_site_use_rec,x_party_site_use_id,x_return_status,x_msg_count,x_msg_data);dbms_output.put_line(SubStr(’x_return_status = ’||x_return_status,1,255));dbms_output.put_line(’x_msg_count = ’||TO_CHAR(x_msg_count));dbms_output.put_line(SubStr(’x_msg_data = ’||x_msg_data,1,255));IF x_msg_count >1 THENFOR I IN 1..x_msg_countLOOPdbms_output.put_line(I||’. ’||SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));END LOOP;END IF;END;
Create a Contact Point (Phone)DECLAREp_contact_point_rec HZ_CONTACT_POINT_V2PUB.CONTACT_POINT_REC_TYPE;p_edi_rec HZ_CONTACT_POINT_V2PUB.EDI_REC_TYPE;p_email_rec HZ_CONTACT_POINT_V2PUB.EMAIL_REC_TYPE;p_phone_rec HZ_CONTACT_POINT_V2PUB.PHONE_REC_TYPE;p_telex_rec HZ_CONTACT_POINT_V2PUB.TELEX_REC_TYPE;p_web_rec HZ_CONTACT_POINT_V2PUB.WEB_REC_TYPE;x_return_status VARCHAR2(2000);x_msg_coun t NUMBER;x_msg_data VARCHAR2(2000);x_contact_point_id NUMBER;BEGINp_contact_point_rec.contact_point_type := ’PHONE’;p_contact_point_rec.owner_table_name := ’HZ_PARTIES’;p_contact_point_rec.owner_table_id := ’1272023’;p_contact_point_rec.primary_flag := ’Y’;p_contact_point_rec.contact_point_purpose := ’BUSINESS’;p_phone_rec.phone_area_code := ’650’;p_phone_rec.phone_country_code := ’1’;p_phone_rec.phone_number := ’506-7000’;p_phone_rec.phone_line_type := ’GEN’;p_contact_point_rec.created_by_module := ’TCA_EXAMPLE’;hz_contact_point_v2pub.create_contact_point( ’T’, p_contact_point_rec,p_edi_rec, p_email_rec,p_phone_rec,p_telex_rec,p_web_rec,x_contact_point_id,x_return_status,x_msg_count,x_msg_data);dbms_output.put_line(SubStr(’x_return_status = ’||x_return_status,1,255));dbms_output.put_line(’x_msg_count = ’||TO_CHAR(x_msg_count));dbms_output.put_line(SubStr(’x_msg_data = ’||x_msg_data,1,255));IF x_msg_count >1 THENFOR I IN 1..x_msg_countLOOPdbms_output.put_line(I||’. ’||SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));END LOOP;END IF;END;
Create an Org ContactDECLAREp_org_contact_rec HZ_PARTY_CONTACT_V2PUB.ORG_CONTACT_REC_TYPE;x_org_contact_id NUMBER;x_party_rel_id NUMBER;x_party_id NUMBER;x_party_number VARCHAR2(2000);x_return_status VARCHAR2(2000);x_msg_count NUMBER;x_msg_data VARCHAR2(2000);BEGINp_org_contact_rec.department_code := ’ACCOUNTING’;p_org_contact_rec.job_title := ’ACCOUNTS OFFICER’;p_org_contact_rec.decision_maker_flag := ’Y’;p_org_contact_rec.job_title_code := ’APC’;p_org_contact_rec.created_by_module := ’TCA_EXAMPLE’;p_org_contact_rec.party_rel_rec.subject_id := 16077;p_org_contact_rec.party_rel_rec.subject_type := ’PERSON’;p_org_contact_rec.party_rel_rec.subject_table_name := ’HZ_PARTIES’;p_org_contact_rec.party_rel_rec.object_id := 1272023;p_org_contact_rec.party_rel_rec.object_type := ’ORGANIZATION’;p_org_contact_rec.party_rel_rec.object_table_name := ’HZ_PARTIES’;p_org_contact_rec.party_rel_rec.relationship_code := ’CONTACT_OF’;p_org_contact_rec.party_rel_rec.relationship_type := ’CONTACT’;p_org_contact_rec.party_rel_rec.start_date := SYSDATE;hz_party_contact_v2pub.create_org_contact(’T’, p_org_contact_rec, x_org_contact_id,x_party_rel_id, x_party_id, x_party_number, x_return_status, x_msg_count, x_msg_data);dbms_output.put_line(SubStr(’x_return_status = ’||x_return_status,1,255));dbms_output.put_line(’x_msg_count = ’||TO_CHAR(x_msg_count));dbms_output.put_line(SubStr(’x_msg_data = ’||x_msg_data,1,255));IF x_msg_count >1 THENFOR I IN 1..x_msg_countLOOPdbms_output.put_line(I||’. ’||SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));END LOOP;END IF;END;
Create a Customer AccountDECLAREp_cust_account_rec HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE;p_person_rec HZ_PARTY_V2PUB.PERSON_REC_TYPE;p_customer_profile_rec HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE REC_TYPE;x_cust_account_id NUMBER;x_account_number VARCHAR2(2000);x_party_id NUMBER;x_party_number VARCHAR2(2000);x_profile_id NUMBER;x_return_status VARCHAR2(2000);x_msg_count NUMBER;x_msg_data VARCHAR2(2000);BEGINp_cust_account_rec.account_name := ’John’’s A/c’;p_cust_account_rec.created_by_module := ’TCA_EXAMPLE’;p_person_rec.person_first_name := ’John’;p_person_rec.person_last_name := ’Smith’;hz_cust_account_v2pub.create_cust_account( ’T’, p_cust_account_rec, p_person_rec,p_customer_profile_rec, ’F’, x_cust_account_id, x_account_number, x_party_id,x_party_number,x_profile_id,x_return_status,x_msg_count,x_msg_data);dbms_output.put_line(SubStr(’x_return_status = ’||x_return_status,1,255));dbms_output.put_line(’x_msg_count = ’||TO_CHAR(x_msg_count));dbms_output.put_line(SubStr(’x_msg_data = ’||x_msg_data,1,255));IF x_msg_count >1 THENFOR I IN 1..x_msg_countLOOPdbms_output.put_line(I||’. ’||SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));END LOOP;END IF;END;
This routine is used to create a Customer Account. The API creates a record in the HZ_CUST_ACCOUNTS table for party type Person or Organization. Account can be created for an existing party by passing party_id of the party. Alternatively, this routine creates a new party and an account for the party. Customer profile record in the HZ_CUSTOMER_PROFILES can also be created while calling this routine based on value passed in p_customer_profile_rec. The routine is overloaded for Person and Organization.
Create a Cust Account Site using an Existing Party SiteDECLAREp_cust_acct_site_rec hz_cust_account_site_v2pub.cust_acct_site_rec_type;x_return_status VARCHAR2(2000);x_msg_count NUMBER;x_msg_data VARCHAR2(2000);x_cust_acct_site_id NUMBER;BEGINp_cust_acct_site_rec.cust_account_id := 3472;p_cust_acct_site_rec.party_site_id := 1024;p_cust_acct_site_rec.language := ’US’;p_cust_acct_site_rec.created_by_module := ’TCA-EXAMPLE’;hz_cust_account_site_v2pub.create_cust_acct_site(’T’,p_cust_acct_site_rec,x_cust_acct_site_id,x_return_status,x_msg_count,x_msg_data);dbms_output.put_line(SubStr(’x_return_status = ’||x_return_status,1,255));dbms_output.put_line(’x_msg_count = ’||TO_CHAR(x_msg_count));dbms_output.put_line(SubStr(’x_msg_data = ’||x_msg_data,1,255));IF x_msg_count >1 THENFOR I IN 1..x_msg_countLOOPdbms_output.put_line(I||’. ’||SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));END LOOP;END IF;END;
Create a Customer Account Site Use CodeDECLAREp_cust_site_use_rec HZ_CUST_ACCOUNT_SITE_V2PUB.CUST_SITE_USE_REC_TYPE;p_customer_profile_rec HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE;x_site_use_id NUMBER;x_return_status VARCHAR2(2000);x_msg_count NUMBER;x_msg_data VARCHAR2(2000);BEGINp_cust_site_use_rec.cust_acct_site_id := 3580;p_cust_site_use_rec.site_use_code := ’INV’;p_cust_site_use_rec.location := ’TCA’;p_cust_site_use_rec.created_by_module := ’TCA_EXAMPLE’;hz_cust_account_site_v2pub.create_cust_site_use(’T’,p_cust_site_use_rec,p_customer_profile_rec,’’,’’,x_site_use_id,x_return_status,x_msg_count,x_msg_data);dbms_output.put_line(SubStr(’x_return_status = ’||x_return_status,1,255));dbms_output.put_line(’x_msg_count = ’||TO_CHAR(x_msg_count));dbms_output.put_line(SubStr(’x_msg_data = ’||x_msg_data,1,255));IF x_msg_count >1 THENFOR I IN 1..x_msg_countLOOPdbms_output.put_line(I||’. ’||SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));END LOOP;END IF;END;
Org Contact Role Hz_party_contact_v2pub.Create_Org_Contact_Role
Customer contacts HZ_CUST_ACCOUNT_ROLE_V2PUB.CREATE_CUST_ACCOUNT_ROLE
Customer Contact Role
HZ_CUST_ACCOUNT_ROLE_V2PUB.create_role_responsibility
Relationships HZ_CUST_ACCOUNT_V2PUB.CREATE_CUST_ACCT_RELATE
Customer Profile HZ_CUSTOMER_PROFILE_V2PUB. create_customer_profile
Customer Profile Amount
HZ_CUSTOMER_PROFILE_V2PUB. create_cust_profile_amt
Customer Credit Rating
HZ_PARTY_INFO_V2PUB.create_credit_rating
Sales Person JTF_RS_SALESREPS_PUB.CREATE_SALESREP
Sales reps Territories
JTF_RS_SRP_TERRITORIES_PUB.CREATE_RS_SRP_TERRITORIES