Salesforce

Salesforce - XML (Magic xpi 4.7)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Salesforce - XML (Magic xpi 4.7)

The Salesforce connector is designed to work with Magic xpi’s XML interface. When you drag the Salesforce connector into a flow, the Properties pane opens. Select the XML interface, then double-click or right-click on the component and select Configuration from the context menu to open the Salesforce Configuration dialog box.

This dialog box contains the following fields:

Property

Description

Connection

Resource Name

The name of the resource that you selected in the component's Properties pane. The resources are defined in the Settings dialog box's Resources section.

Operation

Object

Click to open the Objects List. Select the object that the operation will be performed on. This list is generated when you validate the resource in the Salesforce Resource dialog box.

The Objects list has to be built in the resource; otherwise, you will not be able to get the Objects list in the step or trigger.

Operation

Select one of the following operations from the drop-down list:

  • Query: This is used to retrieve data from an object. You can use the Data Mapper to retrieve objects based on specific criteria. If there are multiple records in the Source, only the first mapped value will be returned.

  • Query All: This is identical to the Query operation except that it also returns the deleted records from Salesforce (deleted records are identified by the IsDeleted element true value).

  • Bulk Query: This is used to query large data sets. It should be used in conjunction with the Bulk Retrieve Query Results method to retrieve the required results.
    Since version: 4.1

  • Create: This is used to create new objects in your organization’s data. You can use the Data Mapper to specify new object fields’ values.

  • Bulk Create: This is identical to the Create operation except that it allows you to work with an external file containing many records.

  • Update: This is used to update a specific object in your organization’s data. When you update an object, you need to know its ID. For example, you can use the Query operation (above) to retrieve an object ID, and then you can call the Update operation. You should use the Data Mapper to set the object ID, as well as the other fields that you want to update.

  • Bulk Update: This is identical to the Update operation except that it allows you to work with an external file containing many records.

  • Delete: This is used to delete a specific object from your organization’s data. If you want to delete an object, you need to know its ID. For example, you can use the Query operation (above) to retrieve an object ID, and then you can call the Delete operation. You should use the Data Mapper to set the object ID. This is the only value that you should set.

  • Bulk Delete: This is identical to the Delete operation except that it allows you to work with an external file containing many records.

  • Upsert: This is used to prevent the insertion of duplicate records into Salesforce. The Upsert operation checks, based on field values, the existence of an object instance and updates the object if one exists or inserts a new one if it does not. The Upsert option is only available for objects that can be both updated and created.

  • Bulk Upsert: This is identical to the Upsert operation except that it allows you to work with an external file containing many records.

Only object-supported operations (based on the object type and user privileges) are displayed.

Batches Mode

This field is only available when you select one of the Bulk operations in the Operation field. It enables you to control the way in which a job processes batches. Select one of the following from the drop-down list:

  • Parallel (default): Batches are processed simultaneously.

  • Linear: Batches are processed one after the other.

Batch Size

This field is only available when you select Create, Update, or Upsert in the Operation field.

This controls the maximum number of objects sent in each request to Salesforce. Enter a value between 1 and 200.

Upsert Field Name

This field is only available when you select Upsert or Bulk Upsert in the Operation field.

The fields that are listed are the unique fields for the selected object. At least one object must be selected for the Upsert lookup process. The selected object must be mapped with a value later on.

When working with the Bulk Upsert operation, the field selected here must also be selected in the Object Fields List so that it will appear in the Data Mapper screen.

For more details, see the Upsert operation in the Salesforce API documentation.

New Object ID

This field is only available when you select Create or Upsert in the Operation field.

Click to open the Variables List and select a variable that will hold the object ID that was upserted.

Return Fields

This field is only available when you select Query, Query All, or Bulk Query in the Operation field.

You can choose All by selecting the adjacent check box, or you can select specific fields from the Object Fields List.

Return Child Objects

This field is only available when you select Query, Query All, or Create in the Operation field.

If you selected Query or Query All in the Operation field, the object will be fetched together with its selected child objects to a single XML file.

You can perform a query on both the parent object and its child objects.

If you selected Create in the Operation field, the object will be fetched together with its selected child objects.

Click to open the Child Objects List. Here, you can select the child objects that you want to return.

You cannot perform Query or Query All operations on an object that has more than 20 child objects selected.

Object Fields

This field is only available when you select one of the Bulk operations in the Operation field.

Click to open the Object Fields List. This enables you to select the required object fields and fill in their relationship details. You can enter relationship data for Index and External ID fields only. By default, no fields are selected.

Return Job ID

This field is only available when you select one of the Bulk operations in the Operation field.

Click to open the Variables List and select a variable that will hold the returned job ID.

Result Options

Store result in

Defines where you want to store the resulting XML file. Select one of the following from the drop-down list:

  • File: Select a file to hold the object data that is returned by Salesforce. Click to open the Expression Editor or click and enter the file path where this information is to be stored.

  • Variable (default is C.UserBlob): Select a variable to hold the object data that is returned by Salesforce.
    Click to open the Variables List. Select a variable where this information is to be stored.

  • Split files: Splits a large XML file into several smaller XML files. If you select this option, you need to enter the required information in the Split Files Options section of this dialog box (below).

Operation success

This field lets you easily determine if the data object was successfully located in Salesforce. Select one of the following from the drop-down list:

  • None (default): Select this option if you do not want to save the connector’s success or failure status.

  • Variable: Select the variable where you want to store the connector's success or failure status.

When working with any of the Bulk operations (above), this field determines whether the Salesforce job was successfully created by Magic xpi.

Split Files Options

Directory

The directory holding the split files. Click to open the Expression Editor and enter the directory name.

Prefix

The prefix of the split files. Click to open the Expression Editor and enter the prefix.

Records per file

The number of records in each split file. Click to open the Expression Editor and enter the required number of records.

Number of splits

The numeric variable where the number of splits will be returned to. Click to open the Variables List and select the required variable.

The Salesforce Configuration dialog box contains the following additional button:

Button

Description

Refresh XSD

Refreshes the current schema.

When you click Refresh XSD, the current schema is overwritten. A message dialog opens, and clicking OK confirms the update and the overwrite. Clicking Cancel exits the process without updating the schema.

  • When using the Create object and Update object operations, you should be aware of fields that cannot be created or updated during the mapping of fields, and of fields that require a predefined set of values. The Additional XML Properties section of each fields' Properties pane gives you the necessary information.

  • The Bulk Query operation does not support the following SOQL statements:

    • COUNT

    • ROLLUP

    • SUM

    • GROUP BY CUBE

    • OFFSET

    • Nested SOQL queries

    • Relationship fields

  • The repeatable element from the Data Mapper Source should be mapped to the row compound of the Salesforce object.

  • Object fields which allow null values can be mapped and populated with null values within Magic xpi.

  • For advanced queries, you can map a free text SOQL WHERE statement in the generated XSD's SOQL compound. This compound can be used in the Query and QueryAll methods. The compound has one string child called WHERE. You can map the WHERE part of the SOQL statement to this element and the WHERE part will be appended to the WHERE statement built during the mapping process.

Related Topics

Salesforce - Referencing Objects by External IDs

Reference
Attachment 
Attachment