Sending Updates

The RETS IQ RETS Library provides a method to send record updates via RETS where the target RETS server allows it.

Updates consist of an update path, a HashMap with the field names and field values and an optional flag whether the record should actually be entered if validated or just tested for validation.

The update path is made up of the Resource, the Classification and the Update Type. The format of the update path is as follows: /<Resource>/<Classification>/<UpdateType>

  // Update path to edit a residential record.
  String path     = "/Property/Residential/EDIT";
    
  // Fields to update
  Map record = new HashMap();
  record.put("UID", "123456");
  record.put("AGENTLIST",     "AGENT1");
  record.put("OFFICELIST",    "OFFICE1");
  record.put("STREETNUM",     "123");
    
  // Execute the update
  UpdateResponse response = session.update(
      path, record, false);
    
  // Check for errors and print them out
  if(!response.getUpdateSuccess()) {
    for(UpdateError err: response.getErrors()) {
      System.out.println("Error=" + err);
    }
  }
          

See the example.