Results of Add / Update / Delete Functions

Add, update, and delete functions return a writeResult object. This object contains two arrays: results and errors. The results array will contain N resultItem objects, where N is the number of objects you provided for the function. Each resultItem object has the following elements:

  • id: the id of the element, if it already existed at Bronto
  • isNew: a boolean indicating whether a new object was created or not.
  • isError: a boolean indicating whether or not a problem occurred when calling the function with this object.
  • errorCode: a numeric code for the type of error, if one occurred while calling the function with this object.
  • errorString: a description of an error, if one occurred while calling the function with this object.

The order of the results array will match the order of the objects you originally provided to the function, so you can map back the resultItem objects to your own objects to take any further action you require.

As an additional convenience, if there were any errors, a second array called errors will also be provided. This array will contain integers indicating the index in the results array of all resultItem objects that had errors, so if you do not wish to iterate over the entire results array, you can quickly pick out any problems. A complete description of all error codes and messages is available.


Was this article helpful?

Not HelpfulHelpful (-3 rating, 5 votes)
Loading...

We welcome your feedback!

Please let us know how this article could be improved.
*Name and Email are optional fields.