Update

From API Documentation

Jump to: navigation, search

Updates the information in one or more objects of the same type. You can specify different types of objects in different update calls, but each specific update call must only apply to one type of object.

Syntax and Argument


SaveResult[] = update(zObject[])

The argument is as shown in the following table. For information on the field types, see Field Types.

Argument Description
zObject[] An array of one or more zObjects (of the same type) that you wish to update.


Using This Call

You can call update on an array of zObjects. It returns an array of SaveResults indicating the success or failure of updating each object. The following information applies to this call:

  • You cannot pass in any null zObjects.
  • You can pass in a maximum of 50 zObjects at a time.
  • All objects on update must be of the same type.
  • For each field in each object, you will need to determine that object's ID. Then, populate the fields you wish to update with the information you wish to update that object with.
  • SaveResult should be in the Response section of update.

Response

SaveResult

Faults

InvalidTypeFault

UnexpectedErrorFault

Sample Code

ID id = new ID();
id.setID(accountId);

Account acc = new Account();
acc.setId(id);
acc.setName("Update Account Name");
ZObject[] objs = new ZObject[1];
objs[0] = acc;

Update update = new Update();
update.setZObjects(objs);
UpdateResponse uResp = stub.update(update, this.header);

SaveResult[] res = uResp.getResult();
ID updatedAccountId = res[0].getId();

SaveResult