Newer Version Available

This content describes an older version of this product. View Latest

Sample update() Call

These Java and C# examples show how to use the update() call for the Partner WSDL.

Each example takes the ID of the contact to update() as an argument. It creates two sObject records of type Contact—one to hold the valid passed in ID and the other has an invalid ID. Next, it sets a new phone number for the valid contact and null for the last name of the invalid contact. It then makes the update call and iterates through the results. For a successful update operation, it writes the ID of the contact that got updated. For a failed update operation, it writes the details of all returned errors to the console. In this case, the output is the ID of the contact that was successfully updated and an error for the invalid contact update.

To execute the sample method, you can use the corresponding Java or C# template class provided in Examples Using the Partner WSDL.

Java Example

For more information about setFieldsToNull (or its equivalent in client tools other than WSC), see fieldsToNull.

C# Example