Parameters
NameTypeDescription
recordsys.data.RecordThe record where the interaction will be executed.
interactionsys.data.InteractionInteraction object to access parameters of the interaction.
Samples
 
//validates the zip code using an external service
var errors = [];
var zipCode = interaction.field('address.zipCode').val();
if (!app.endpoints.addressValidator.isValidZipCode(zipCode)) {
  errors.push({
    path: 'address.zipCode',
    code: 'invalid',
    message: 'Wrong zip code'
  });
}
return errors;