How to add custom method before saving like if that method will succeed then call the save if error then show some error message in recordlistview saving in cell

How to add custom method before saving like if that method will succeed then call the save if error then show some error message in recordlistview saving in cell

Parents Reply Children
  • im trying to use addValidationTask in recordlistview but the custom validation method is not triggered right after saving

  • ({
    extendsFrom: 'RecordlistView',
    initialize: function (options) {
    this._super('initialize', [options]);
    this.model.addValidationTask('check_products', _.bind(this.checkProducts, this));
    },

    checkProducts: function(fields, errors, callback) {
    console.log('triggered checkProducts')
    console.log('checkProducts', Object.values(this.toggledModels)?.[0])

    callback(null, fields, errors);
    },

    })



    this is how i add the addValidationTask in recordlistview but it seem checkProducts are not loggging