フィールド更新時に別のフィールドを更新

var editEvents = ['app.record.create.show', 'app.record.edit.show'];
kintone.events.on(editEvents, function(event) {
  console.log("accessed to editpage");
  kintone.events.on('app.record.edit.change.フィールド1', function(event) {
    console.log("changed field1");
    updateField(event, "フィールド2", "yes");
    return event;
  });
});

var updateField = function(event, field, value) {
  var record = event.record;
  record[field].value = value;
  return event;
};