Adapter for Salesforce 8.2 | webMethods Adapter for Salesforce Documentation | webMethods Adapter for Salesforce Installation and User’s Documentation | Adapter Services | Configuring Update Operation Adapter Services
 
Configuring Update Operation Adapter Services
Use the Update Operation template to configure an adapter service that updates records of one or multiple Salesforce objects. The update operation wraps the update call of the Salesforce.com Web service API.
As a response, the Salesforce.com update call returns a SaveResult object. The adapter service returns the information from the SaveResult object as output.
Output Variable
Description
id
String The ID of an updated record.
success
Boolean Whether the update call successfully updated a record. If success is:
*true Records were updated successfully.
*false Updating records failed.
errors
String List When success is false, errors provides the error codes and descriptions of the errors that the update call encountered.
The input signature of the adapter service contains the name of the Salesforce object or objects that you selected as input parameters. For example, when you select the Account object, the input signature contains Account as input parameter. Each object is a Document List that holds the field values and IDs for the records to update. At run time, pass the adapter service one Document within the sobjects Document List for each record you want to update.
The output signature of the adapter service contains a results Document List. Each Document in the input sobjects Document List maps to an output Document in the results Document List.
*To configure an adapter service that uses the Update Operation template
1. Review the steps in Before Configuring or Managing Adapter Services.
2. Start Designer.
3. Right-click the package in which the service should be contained and select New > Adapter Service.
4. Select the parent namespace, type a name for the adapter service, and click Next.
5. Select Adapter for Salesforce as the adapter type and click Next.
6. Select the appropriate Adapter Connection Name and click Next.
Important:
Ensure the Salesforce.com user account identified by the connection has all the required permissions to update records in the Salesforce object that you will select later in the procedure.
7. From the list of available templates, select the Update Operation template and click Finish.
The adapter service editor for the adapter service appears. You can select the Adapter Settings tab at any time to confirm adapter service properties such as the Adapter Name, Adapter Connection Name, and Adapter Service Template, as necessary.
8. In the Select column on the Schema tab, select the check boxes for one or more Salesforce objects into which you want to update records.
9. To use an External ID for a Salesforce object, select the check box for the Salesforce object in the Show External ID column.
10. On the Update Operation tab, click the icon to populate the table with the fields of the Salesforce objects you selected.
11. In the Use Field column, select the check box for every name Id field in the Input Parameter column, where name is the name of the Salesforce object you selected.
For example, if you selected the Account and Contact Salesforce objects, you have to select the check boxes for the Account.Id and Contact.Id fields respectively.
The name Id field is included in the input parameters, providing a variable for passing the IDs of the records that the adapter service is to update.
12. For each field that you want to update in the record, select the check box in the Use Field column.
For example, if you are defining an adapter service that updates records in the Account and Contact Salesforce objects, you might set up the adapter service to update the Account.Name and Account.Type fields, and the Contact.LastName and Contact.FirstName fields.
The fields you specify become part of the input signature for the adapter service. When invoking the adapter service, pass the values for the selected fields as input. To reset a non-required field to null, pass a null value for the field.
Important:
When using an update operation adapter service, be sure to specify field values that maintain the referential integrity of the Salesforce objects.
Note:
The Update Operation template lists only fields that you can update for a Salesforce object. If Salesforce.com does not allow you to update a field, for example the MasterRecordId field for a Contact Salesforce object, the adapter service template does not list the field for selection.
At run time, the adapter service determines whether the values specified for the fields are valid, for example ensuring that a date value is specified for a field that has a java.util.Date data type. If an invalid value is detected, the adapter issues an error message and does not attempt to update the record.
13. To update a record in a table that has a reference to a record in another sObject, select the fields in an sObject designated with External IDs. The Relationship Name column shows the sObject record that the selected External ID field relates to. For information about how to assign an External ID to a record field, see Assigning External IDs to sObject Record Fields.
14. Select File > Save to save the adapter service.