8Import and Export Custom Objects
This chapter contains the following:
Overview of Import and Export of Custom Objects
Before you can import and export data for custom objects, you must first generate the object artifacts required for both file-based import and bulk export. You can generate the object artifacts and subsequently import and export custom objects.
Enable Import and Export for Custom Objects
The changes you make using Application Composer don't automatically create the artifacts required by the import and export processes.
Accordingly, after completing your object model extensions, you must generate the required artifacts to register your extensions and make them available for importing and exporting data.
To enable the import and export of custom object data:
-
Confirm that you're not in a sandbox.
-
In the Application Composer, select the Import and Export link in the Common Setup pane, or in the local area of the main Overview page.
-
In the Import and Export page, click Generate .
After you generate the required artifacts, you can schedule your file-based import and bulk export processes. Navigate to the following in the Setup and Maintenance work area and search on the task name:
-
Offering: Sales
-
Functional Area: Data Import and Export
-
To schedule your custom object imports, select the Manage File Import Activities task.
To initially set up file-based import for importing custom object data, select the Manage File Import Objects and Manage File Import Mappings tasks.
Custom child objects are imported as part of the parent object. You can mark the RecordName for a custom object as unique using the Application Composer. If marked as unique and the RecordName value in the source file record is unique (no matching record exists in the CSV file or database table), then the import activity is successful for both insert and update operations. If the RecordName is marked as unique and the RecordName value in the source file record isn't unique (matching record exists in the CSV file or database table), then the import activity fails. If the RecordName for a custom object isn't marked as unique, you can insert a duplicate record but can't update a record based on the RecordName field.
-
To schedule your custom object exports, select the Schedule Export Processes task.
Both top-level and child custom objects are available as independent exportable objects.
-
To schedule the hierarchical export of your custom objects, select the Manage File Export Activities task.
Custom child objects are exported based on the parent object. While exporting the data, you must provide a filter criterion and save it.
Refer to the product-specific documentation for additional details on the user-defined fields for standard objects.
Insert Custom Object Data
You can insert custom object data into CX Sales and B2B Service.
Create the Parent and Child Custom Objects
To create the parent and child custom objects:-
Navigate to theApplication Composer.
-
Click the Custom Objects icon on the Overview screen.
-
Click the Create New Object icon to bring up the Create Custom Object window. Note that your environment must be in an active sandbox.
-
Enter the value
SalesOrder
for Display Label. Remaining fields are automatically populated. This creates the parent custom objectSalesOrder
. -
Create the custom fields by clicking the Fields option under the
SalesOrder
object. Provide the display names OrderName and OrderCount for the fields. -
Click the SalesOrder icon on the side pane. In the Overview page, click Create Child Object to create the child object SalesOrderItem.
-
Create the custom fields
ItemName
andItemCount
. -
Publish and sign out from the sandbox.
-
Navigate to Import and Export under Application Composer. Click Generate to generate the artifacts for the custom objects.
Insert Data for Parent Custom Object
To insert data for parent custom objects only:-
Create the CSV file, as shown in this table:
Record Name SalesOrder.OrderName_c SalesOrder.OrderCount_c SalesOrder1
Amazon600
2000
SalesOrder2
Amazon900
3000
-
In the Setup and Maintenance work area, navigate to the following:
-
Offering: Sales
-
Functional Area: Data Import and Export
-
Task: Manage File Import Activities
-
-
Click the Create icon to create an import activity InsertCustomObject. For more information about the duties and roles required to import custom objects, see the Related Links section at the end of this topic.
-
In the Create Import Activity page, provide the file name InsertCustomObject and select the custom object from the Object drop-down list. Select the File Type Text file and browse the CSV file that you created in step 1. Click Next.
-
In the mapping page, map the attributes as shown in this table:
SEQUENCE_NUMBER COLUMN_HEADER SAMPLE_VAL TARGET_OBJECT TARGET_OBJECT_ATTRIBUTE 1
Parent Record Name
SalesOrder1
SalesOrder_cWBIT
RecordName
2
SalesOrder Name
Amazon600
SalesOrder_cWBIT
OrderName_c
3
SalesOrder Count
2000
SalesOrder_cWBIT
OrderCount_c
-
Review and activate the import activity.
Note: If there are any mandatory fields in the custom object, include them in the CSV file and provide a value for all records when performing an insert. Map the required values in the mapping page. In this example, OrderName_c is a mandatory attribute.
Insert a Child for Each New Parent
To insert data for one child for each new parent custom object:-
Create the CSV file, as shown in this table:
Parent Record Name SalesOrder.OrderName SalesOrder.OrderCount Child Record Name SalesOrderItem.ItemName SalesOrderItem.ItemCount SalesOrder1
Amazon600
2000
SalesOrder1_Item1
Electronics
50
SalesOrder2
Amazon900
3000
SalesOrder2_Item1
Stationery
100
SalesOrder3
Amazon1200
5000
SalesOrder3_Item1
Computer Accessories
50
-
In the Setup and Maintenance work area, navigate to:
-
Offering: Sales
-
Functional Area: Data Import and Export
-
Task: Manage File Import Activities
-
-
Click the Create icon to create an import activity InsertCustomObject. For more information about the duties and roles required to import custom objects, see the Related Links section at the end of this topic.
-
In the Create Import Activity page, provide the file name InsertCustomObject and select the object Sales custom object from the Object drop-down list. Select the File Type Text file and browse the CSV file that you created in step 1. Click Next.
-
In the mapping page, map the attributes as shown in this table:
SEQUENCE_NUMBER COLUMN_HEADER SAMPLE_VAL TARGET_OBJECT TARGET_OBJECT_ATTRIBUTE 1
Parent Record Name
SalesOrder1
SalesOrder_cWBIT
RecordName
2
SalesOrder.OrderName
Amazon600
SalesOrder_cWBIT
OrderName_c
3
SalesOrder.OrderCount
2000
SalesOrder_cWBIT
OrderCount_c
4
Child Record Name
SalesOrder1_Item1
SalesOrderItem_cWBIT
RECORD_NAME
5
SalesOrderItem.ItemName
Electronics
SalesOrderItem_cWBIT
ItemName_c
6
SalesOrderItem.ItemCount
50
SalesOrderItem_cWBIT
ItemCount_c
Note: The child record name must be unique. Add the value of the parent record name with the item. For example, the sample value of the child record name is SalesOrder1_Item1. -
Review and activate the import activity.
Insert Multiple Child Records for a Parent Record
After inserting the parent record, you can insert data for child records associated with the parent record. To insert data for multiple child records for an existing parent custom object:-
Create the CSV file, as shown in this table:
Parent Record Object Key Parent Record Name Child Record Name ChildFKey SalesOrderItem.ItemName SalesOrderItem.ItemCount 300100035820958
SalesOrder1
SalesOrder1_Item1
300100035820958
Electronics
150
Leave value blank
Leave value blank
SalesOrder1_Item2
300100035820958
Stationery
200
Leave value blank
Leave value blank
SalesOrder1_Item3
300100035820958
Computer Accessories
500
-
Navigate to the Manage File Import Activities task from the Setup and Maintenance work area.
-
Offering: Sales
-
Functional Area: Data Import and Export
-
Task: Manage File Import Activities
-
-
Click the Create icon to create an import activity InsertCustomObject. For more information about the duties and roles required to import custom objects, see the Related Links section at the end of this topic.
-
In the Create Import Activity page, provide the file name InsertCustomObject and select the custom object from the Object drop-down list. Select the File Type Text file and browse the CSV file that you created in step 1. Click Next.
-
In the mapping page, map the attributes as shown in this table:
SEQUENCE_NUMBER COLUMN_HEADER SAMPLE_VAL TARGET_OBJECT TARGET_OBJECT_ATTRIBUTE 1
Parent Record Object Key
300100035820958
SalesOrder_cWBIT
ObjectKey
2
Parent Record Name
SalesOrder1
SalesOrder_cWBIT
RecordName
3
Child Record Name
SalesOrder1_Item1
SalesOrderItem_cWBIT
RECORD_NAME
4
SalesOrderItem.ItemName
Electronics
SalesOrderItem_cWBIT
ItemName_c
5
SalesOrderItem.ItemCount
150
SalesOrderItem_cWBIT
ItemCount_c
6
ChildFKey
300100035820958
SalesOrderItem_cWBIT
SalesOrder_Id_c
Note: The child record name must be unique. Add the value of the parent record name with the item. For example, the sample value of the child record name is SalesOrder1_Item1. -
Review and activate the import activity.
Insert Multiple Child Records for Different Parent Records
After inserting the parent record, you can insert data for child records of the parent record. The Parent Record Object Key values will be different depending on the parent record for which the child records are inserted. To insert data for multiple child records with different parent custom objects:-
Create the CSV file, as shown in this table:
Parent Record Object Key Parent Record Name Child Record Name ChildFKey SalesOrderItem.ItemName SalesOrderItem.ItemCount 300100035820958
SalesOrder1
SalesOrder1_Item1
300100035820958
Switches
50
Leave value blank
Leave value blank
SalesOrder1_Item2
300100035820958
Sockets
100
Leave value blank
Leave value blank
SalesOrder1_Item3
300100035820958
Regulators
50
300100035820960
SalesOrder2
SalesOrder2_Item1
300100035820960
Pencils
50
Leave value blank
Leave value blank
SalesOrder2_Item2
300100035820960
Sharpener
100
Leave value blank
Leave value blank
SalesOrder2_Item3
300100035820960
Eraser
50
-
In the Setup and Maintenance work area, navigate to:
-
Offering: Sales
-
Functional Area: Data Import and Export
-
Task: Manage File Import Activities
-
-
Click the Create icon to create an import activity InsertCustomObject. For more information about the duties and roles required to import custom objects, see the Related Links section at the end of this topic.
-
In the Create Import Activity page, provide the file name InsertCustomObject and select the custom object from the Object drop-down list. Select the File Type Text file and browse the CSV file that you created in step 1. Click Next.
-
In the mapping page, map the attributes as shown in this table:
SEQUENCE_NUMBER COLUMN_HEADER SAMPLE_VAL TARGET_OBJECT TARGET_OBJECT_ATTRIBUTE 1
Parent Record Object Key
300100035820958
SalesOrder_cWBIT
ObjectKey
2
Parent Record Name
SalesOrder1
SalesOrder_cWBIT
RecordName
3
Child Record Name
SalesOrder1_Item1
SalesOrderItem_cWBIT
RECORD_NAME
4
SalesOrderItem.ItemName
Electronics
SalesOrderItem_cWBIT
ItemName_c
5
SalesOrderItem.ItemCount
150
SalesOrderItem_cWBIT
ItemCount_c
6
ChildFKey
300100035820958
SalesOrderItem_cWBIT
SalesOrder_Id_c
Note: The child record name must be unique. Add the value of the parent record name with the item. For example, the sample value of the child record name is SalesOrder1_Item1. -
Review and activate the import activity.
Update Custom Object Data
You can update custom object data in CX Sales and B2B Service.
Update Parent Records
To create the parent and child custom objects, review the topic Inserting Custom Object Data: Worked Example referenced in the Related Links section. Perform the following steps to update only the parent records:-
Create the CSV file, as shown in this table:
Parent Record Object Key Parent Record Name SalesOrder.OrderName SalesOrder.OrderCount 300100035820958
SalesOrder1
Amazon600
90000
300100035820960
SalesOrder2
Amazon600
70000
-
In the Setup and Maintenance work area, navigate to:
-
Offering: Sales
-
Functional Area: Data Import and Export
-
Task: Manage File Import Activities
-
-
Click the Create icon to create an import activity UpdateCustomObject. For more information about the duties and roles required to import custom objects, see the Related Links section at the end of this topic.
-
In the Create Import Activity page, provide the file name UpdateCustomObject and select the custom object from the Object drop-down list. Select the File Type Text file and browse the CSV file that you created in step 1. Click Next.
-
In the mapping page, map the attributes as shown in this table:
SEQUENCE_NUMBER COLUMN_HEADER SAMPLE_VAL TARGET_OBJECT TARGET_OBJECT_ATTRIBUTE 1
Parent Record Object Key
300100035820958
SalesOrder_cWBIT
ObjectKey
2
Parent Record Name
SalesOrder1
SalesOrder_cWBIT
RecordName
3
SalesOrder.OrderName
Amazon600
SalesOrder_cWBIT
OrderName_c
4
SalesOrder OrderCount
90000
SalesOrder_cWBIT
OrderCount_c
-
Review and activate the import activity.
Note: The Parent Record Object Key is taken from the log file generated by the parent insert import job.
Update Child Records
To create the parent and child custom objects, review the topic Inserting Custom Object Data: Worked Example referenced in the Related Links section. Perform the following steps to update only the child records:-
Create the CSV file, as shown in this table:
Parent Record Object Key Parent Record Name Child Record Object Key Child Record Name ChildFKey SalesOrderItem .ItemName
SalesOrderItem. ItemCount 300100035820958
SalesOrder1
300100035821118
SalesOrder1_Item1
300100035820958
Switches
2500
Leave value blank
Leave value blank
300100035821120
SalesOrder1_Item2 `
300100035820958
Sockets
1000
-
In the Setup and Maintenance work area, navigate to:
-
Offering: Sales
-
Functional Area: Data Import and Export
-
Task: Manage File Import Activities
-
-
Click the Create icon to create an import activity UpdateCustomObject. For more information about the duties and roles required to import custom objects, see the Related Links section at the end of this topic.
-
In the Create Import Activity page, provide the file name UpdateCustomObject and select the custom object from the Object drop-down list. Select the File Type Text file and browse the CSV file that you created in step 1. Click Next.
-
In the mapping page, map the attributes as shown in this table:
SEQUENCE_NUMBER COLUMN_HEADER SAMPLE_VAL TARGET_OBJECT TARGET_OBJECT_ATTRIBUTE 1
Parent Record Object Key
300100035820958
SalesOrder_cWBIT
ObjectKey
2
Parent Record Name
SalesOrder1
SalesOrder_cWBIT
RecordName
3
Child Record Object Key
300100035821118
SalesOrderItem_cWBIT
ObjectKey
4
Child Record Name
SalesOrder1_Item1
SalesOrderItem_cWBIT
RECORD_NAME
5
SalesOrderItem.ItemName
Switches
SalesOrderItem_cWBIT
ItemName_c
6
SalesOrderItem.ItemCount
2500
SalesOrderItem_cWBIT
ItemCount_c
7
ChildFKey
300100035820958
SalesOrderItem_cWBIT
SalesOrder_Id_c
-
Review and activate the import activity.
Note: The Child Record Object Key is taken from the log file generated by the child insert import job.
Delete Custom Object Data
You can delete custom object data in CX Sales and B2B Service.
Delete Parent Records
To create the parent and child custom objects, review the topic Inserting Custom Object Data: Worked Example referenced in the Related Links section. Perform the following steps to delete only the parent records:-
Create the CSV file, as shown in this table:
Parent Record Name Parent Record Object Key Action Code SalesOrder1
300100035820958
DELETE
SalesOrder2
300100035820960
DELETE
-
In the Setup and Maintenance work area, navigate to:
-
Offering: Sales
-
Functional Area: Data Import and Export
-
Task: Manage File Import Activities
-
-
Click the Create icon to create an import activity DeleteCustomObject. For more information about the duties and roles required to import custom objects, see the Related Links section at the end of this topic.
-
In the Create Import Activity page, provide the file name DeleteCustomObject and select the object Sales custom object from the Object drop-down list. Select the File Type Text file and browse the CSV file that you created in step 1. Click Next.
-
In the mapping page, map the attributes as shown in this table:
SEQUENCE_NUMBER COLUMN_HEADER SAMPLE_VAL TARGET_OBJECT TARGET_OBJECT_ATTRIBUTE 1
Parent Record Object Key
300100035820958
SalesOrder_cWBIT
ObjectKey
2
Parent Record Name
SalesOrder1
SalesOrder_cWBIT
RecordName
3
Action Code
DELETE
SalesOrder_cWBIT
ActionCode
-
Review and activate the import activity.
Delete Child Records
To create the parent and child custom objects, review the topic Inserting Custom Object Data: Worked Example referenced in the Related Links section. Perform the following steps to delete child records for a particular parent record:-
Create the CSV file as shown in this table:
Parent Record Name Parent Record Object Key Child Record Object Key Child Record Name ChildFKey Action Code SalesOrder1
300100035820958
300100035821118
SalesOrder1_Item1
300100035820958
DELETE
Leave value blank
Leave value blank
300100035821120
SalesOrder1_Item2
300100035820958
DELETE
-
In the Setup and Maintenance work area, navigate to:
-
Offering: Sales
-
Functional Area: Data Import and Export
-
Task: Manage File Import Activities
-
-
Click the Create icon to create an import activity DeleteCustomObject. For more information about the duties and roles required to import custom objects, see the Related Links section at the end of this topic.
-
In the Create Import Activity page, provide the file name DeleteCustomObject and select the object Sales custom object from the Object drop-down list. Select the File Type Text file and browse the CSV file that you created in step 1. Click Next.
-
In the mapping page, map the attributes as shown in this table:
SEQUENCE_NUMBER COLUMN_HEADER SAMPLE_VAL TARGET_OBJECT TARGET_OBJECT_ATTRIBUTE 1
Parent Record Object Key
300100035820958
SalesOrder_cWBIT
ObjectKey
2
Parent Record Name
SalesOrder1
SalesOrder_cWBIT
RecordName
3
Child Record Object Key
300100035821118
SalesOrderItem_cWBIT
ObjectKey
4
Child Record Name
SalesOrder1_Item1
SalesOrderItem_cWBIT
RECORD_NAME
5
ChildFKey
300100035820958
SalesOrderItem_cWBIT
SalesOrder_Id_c
6
Action Code
DELETE
SalesOrderItem_cWBIT
ActionCode
-
Review and activate the import activity.
What job roles do I need to import and export custom objects?
Any user who wants to generate the artifacts for custom objects, or import and export custom objects should be assigned the Custom Objects Administration job role (ORA_CRM_EXTN_ROLE). The Custom Objects Administration job role makes it possible to import and export custom objects for both the Common and Sales application categories.
If you implemented CX Sales and B2B Service prior to Release 10 and haven't upgraded to the new R10 security reference role model, then you must have the following duty roles assigned:
Application | Import Duty Role | Duty Role Code | Export Duty Role | Duty Role Code |
---|---|---|---|---|
Custom Object |
Master Data Management Application Administration Duty Sales Administration Duty |
ZCH_ENT_MASTER_DATA_MANAGEMENT_ADMIN_DUTY ZBS_SALES_ADMINISTRATION_DUTY |
Trading Community Export Management Duty Opportunity Export Management Duty |
HZ_TRADING_COMMUNITY_EXPORT_MANAGEMENT_DUTY MOO_OPPORTUNITY_EXPORT_MANAGEMENT_DUTY |
How can I import a custom object with child having child record name different from parent record name?
Edit the CSV files for the child objects to add a column ParentRecordName. This column should have a value that matches the RecordName column of the CSV file for the parent object as shown in this table
Row Number | RecordName |
---|---|
1 |
ParentRecordNameValue |
Parent CSV file structure
Row Number | RecordName | ParentRecordName |
---|---|---|
1 |
ChildRecordNameValue |
ParentRecordNameValue |
Child CSV file structure
In the Map Fields page, map the ParentRecordName column to the ParentRecordName attribute of the child object as shown in this image:
