Generate Multi Data File

Operation Name

Generate Multi Data File

Function Overview

This operation outputs the data, for bulk processing multiple object records in one update-type call, to the local file.
Data of a different object can be output to the file in addition.
The contents of the output file can be updated to Salesforce by performing a [Write Multi Data] process.

Data Model

The data model of this component is the Table Model type.

Properties

For information about using variables, refer to "variables".
Basic Settings
Item name Required/Optional Use of Variables Description Supplement
Name Required Not Available Enter the name that appears on the script canvas.  
Input Data Required Not Available Select the component on the script canvas.  
Required Settings
Item name Required/Optional Use of Variables Description Supplement
Destination Required Not Available Select Global Resources.
  • [Add...]:
    Add new global resource.
  • [Edit...]:
    Global resource settings can be edited by [Edit Resource list].
  • A global resource on API 23.0 or later versions can be specified.
Output file Required Available Input the file path of the CSV format.
By pressing the [Browse] button, an file chooser will be activated and a file can be chosen.
Table Name Required Not Available Select the name of a table in Salesforce.  
Schema definition Required - Set items subject to writing to Salesforce.
  • Limiting the settings to only items needed to be written to Salesforce (deleting unnecessary items from the Schema Definition) helps improve processing performance.
Schema definition/Label Required Not Available Display the lable name of the column of the table specified in [Table Name].  
Schema definition/API Required Not Available Display the API name of the column of the table specified in [Table Name].  
Schema definition/Type Required Not Available Display the data type of the row of the table specified in [Table Name].  
Relationship definition Optional - In the case that relationship items exist in the Schema Definition, set items subject to updating by external key.
By selecting the external key item of the relation counterpart object, it becomes possible to pass data with an established relationship.
Relationship definition/Base field Required Not Available Display the API Name of the row of the relation item of the table specified in [Table Name].  
Relationship definition/Relationship name Required Not Available Display the relationship name of the row of the relation item of the table specified in [Table Name].  
Relationship definition/Related Object Optional Not Available Select the API Name of the relation counterpart object in the relation item column of the table specified in [Table Name].  
Relationship definition/Foreign key field Optional Not Available Select the external key item of the relation counterpart object in the relation item column of the table specified in [Table Name].
  • If omitted, the ID of the relevant record of the relation counterpart object will be passed.
Property Action
Item name Description Supplement
Preview Display the contents of the file specified by [Output file] by activating a previewer.
  • This becomes invalid if the specified file does not exist or a variable is set for [Output file].
  • The contents is displayed in the character encoding specified by [Encoding].
  • The contents of the file cannot be edited.
  • The maximum file size to be displayed by the previewer is 1MB. If the file size exceeds 1MB, the contents up to 1MB from the beginning of the file will be displayed.
Create schema... The items to be read from Salesforce can be added/deleted.
For setting methods, please refer to "Create Schema."
 
Option Settings
Item name Required/Optional Use of Variables Description Supplement
Encoding Required Available Select or input the character encoding of the file to be written.

When input, you can specify encode supported in Java SE Runtime Environment.
Refer to "Supported Encodings"(http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html) for details.
Column name type Required Not Available Choose the display type of the column name, for displaying the schema in mapping.
  • [Label]:
    The label name (item name) defined in Salesforce is displayed.
  • [API] :(default)
    The API reference name defined in Salesforce is displayed.
 
Writing method Required Not Available Select either to add at the end of the file or overwrite, if the specified file already exists.
  • [Append]:(default)
    Add at the end of the file.
  • [Overwirte]:
    Overwrite.
 
Property Action
Item name Description Supplement
Display Table Information... You can check the table structure of the object you are operating.
For more information on how to view the table structure, please refer to Display Table Information
Click [Load All Table Information....] if you would like to check the table structure of other objects.
Load All Table Information... Retrieve all possible table information
After running, you can verify the retrieved information from [Table Information].
 
Read schema definition from file... Select a file from the file chooser and read the name of field API on the first line of the file specified in the comma-separated values. Set this as the schema definition.
  • Please specify "UTF-8" encoding for the selected file.
Transaction
Item name Required/Optional Use of Variables Description Supplement
Enable transaction Required Not Available Choose whether to perform transaction processing.
  • [Checked]:
    Perform transaction processing.
  • [Not Checked]:(default)
    Transaction processing is not performed.
Refer "File type adapter transaction" for more information.
 
Comment
Item name Required/Optional Use of Variables Description Supplement
Comment Optional Not Available You can write a short description of this adapter.
The description will be reflected in the specifications.
 

Schema

Input Schema

The number of columns varies depending on the [Schema definition] settings.
Please refer to "Table Model type schema" for Schema Structure information.

Output Schema

None.

Reading Schema by Mapper

The schema will be read automatically.

Transaction

Transactions is supported.

Transaction is enabled only when [Enable transaction] in [Transaction] is checked..

Usage on PSP Script

Cannot be used on PSP Script.

Available Component variables

Component Variable Name Description Supplement
input_count The number of input data is stored.
  • The default value is null.
file_path The output file path is stored.
  • The default value is null.
server_url The end point URL after Login is stored.
  • The default value is null.
  • This component alone will not login. Therefore, in order to store the value, it must be logged in advanced by other feature that refers to the same global resource.
session_id The session Id is stored.
  • The default value is null.
  • This component alone will not login. Therefore, in order to store the value, it must be logged in advanced by other feature that refers to the same global resource.
message_category In the case that an error occurs, the category of the message code corresponding to the error is stored.
  • The default value is null.
message_code In the case that an error occurs, the code of the message code corresponding to the error is stored.
  • The default value is null.
message_level In the case that an error occurs, the importance of the message code corresponding to the error is stored.
  • The default value is null.
operation_api_exception_code The ExceptionCode of the occured error, in a case of API error, is stored.
  • The default value is null.
  • For any error other than an API Error, the value is not stored.
  • The content to be stored may change according to the version of DataSpider Servista.
operation_error_message If an error occurs, the error message of the occured error is stored.
  • The default value is null.
  • The content to be stored may change according to the version of DataSpider Servista.
operation_error_trace When an error occurs, the trace information of the occured error is stored.
  • The default value is null.
  • The content to be stored may change according to the version of DataSpider Servista.

Usage Example of Writing Multi Data

For writing multiple data, you need to use the [Generate Multi Data File] and the [Write Multi Data] process.
First you need to output multiple object data to a loca file by the [Generate Multi Data File] process, and then update to Salesforce after reading the file contents by the [Write Multi Data] process.

Order of Records and Chunk

When updating the accumulated records in a file by [Write Multi Data] processing, they are divided according to each object type in Salesforce. This divided unit is called a chunk.
In a call for updating process, chunks up to ten can be included.
The rule for dividing into chunks depends on the order of records output by the [Generate Multi Data File] process.
Also, the data will be comitted in units of a chunk. Therefore, if the records that have relationships are included, a parent record should be precedes its child records.
In this case, a child record specifies the relationship to its parent record using the parent's external ID field (Relationship definition).

Multi Data File Format

The [Generate Multi Data File] processing will generate a file of the format defined in the [Write Multi Data] processing. If the format is correct, even independently created files can be used by the [Write Multi Data] processing.

The below formats are for Multi Data Output.
File Name Extention Encode Newline Character
Any CSV Any Auto

The file content is made up of the type of lines from the below and will be repeated for each object.
Specify an ID in the first column of each row.
Row Name ID Description Number of Columns Position
Table Row * Specify one object API name. 1 Column. (excludes the ID column) Output to either the beginning of the file or after the existing [Data Row].
Schema Row ** Define a comma-delimited list of Schema API names to write.
Define in the following format when updating a read attribute by external ID.
"Reference Field Name:Relationship Name:Related Object Name:Foreign Key Field Name"
Write fields of the target schema. (excludes the ID column) Output after the [Table Row].
Data Row (empty) Specify the data of the records to be written as a comma delimitated string.
Please ensure the order of the columns to be output matches the field order specified in the [Schema Row].
Write fields of the target schema. (excludes the ID column) Output after the [Schema Row].
Continue to output Data Rows when representing more than one record.

Relationship definition

Regarding to the updating process of the Reference field, it needed to pass the ID of the referred object and update by Mapper in the previous versions.
By taking in this setting, the automatical obtainment and updating of the ID of the record which responds to the external key, becomes possible by passing the value of the external key item of the reference object.

Create Schema

The data items to be read from and/or to be written into Salesforce can be specified in the creation of a schema.
By specifying only the items indispensable for processing, the data traffic to Salesforce can be reduced, generally improving the processing performance.
When writing into Salesforce (adding or updating), it is necessary to make sure that the items "Not Creatable" and "Not Updatable" are not be chosen.



Number in the Image Name Description Supplement
(1) Selected Fields Select items for reading from and/or writing to Salesforce.  
(2) UnSelected Fields Select items not for reading from and/or writing to Salesforce.
  • You can filter fields by inputting or selecting values from the input above the column name.
    Text fields will be filtered as Starting With the input value.

Display Table Information

This display shows the available operations on Salesforce tables as well as field properties of the tables.
Also, the field information can be printed out.



Number in the Image Name Description Supplement
(1) Table Name Select the table whose structure to be shown.  
(2) Table Information Display the available operations on the selected table.  
(3) Length Display the Number of Digit of item  
(4) External ID Display whether or not the object item is set as an external ID.  
(5) Createble Display whether or not it can be set a value when adding data.  
(6) Updatable Display whether or not it can be set a value when updating data.  
(7) Nullable Display whether or not it can be set NULL when adding or updating data.  
(8) Default value Display whether or not Salesforce automatically set a default value when adding data.  
(9) Reference To Display the referring object name if the item is in reference relationship or master-servant relationship.  

Specification Limits

Main exceptions

Exception Name Reason Resolution
ResourceNotFoundException
Resource Definition is Not Found. Name:[]
[Destination] is not specified. Specify [Destination].
ResourceNotFoundException
Resource Definition is Not Found. Name:[<Global Resource Name>]
The resource definition selected in [Destination] cannot be found. Verify the global resource specified in [Destination]
jp.co.headsol.salesforce.adapter.exception.SalesforceAdapterIllegalArgumentException Invalid value is set for the property of Salesforce adapter. Check the error message, and verify the settings.