i am trying to call a js function from another function. But I am getting an error.
*.js
reset: async function (record, ev) {
// var self=this;
if (ev && ev.target === this) {
this.restoreProductTemplateId = this.recordData.product_template_id;
this.optionalProducts = (ev.data && ev.data.optionalProducts) || this.optionalProducts;
}
console.log('this',this);
await this._super(...arguments);
if (ev && ev.target === this) {
if (ev.data.changes && !ev.data.preventProductIdCheck && ev.data.changes.product_template_id) {
console.log('inside if');
this._onTemplateChange(record.data.product_template_id.data.id, ev.data.dataPointID);
} else if (ev.data.changes && ev.data.changes.product_id) {
console.log('inside else if');
this._onProductChange(record.data.product_id.data && record.data.product_id.data.id, ev.data.dataPointID).then(wizardOpened => {
if (!wizardOpened) {
console.log('inside wizardOpened',wizardOpened);
console.log('this',this);
this._onLineConfigured();
// this.amhere();
}
});
}
}
},
_onLineConfigured: function(){
// alert('am here 77777777777');
var ff = 0.0;
console.log('ff',ff);
var self = this;
this._super.apply(this, arguments);
var parentList = self.getParent();
var unselectRow = (parentList.unselectRow || function() {}).bind(parentList); // form view on mobile
if (self.optionalProducts && self.optionalProducts.length !== 0) {
self.trigger_up('add_record', {
context: self._productsToRecords(self.optionalProducts),
forceEditable: 'bottom',
allowWarning: true,
onSuccess: function () {
// Leave edit mode of one2many flist.
unselectRow();
}
});
}else if (!self._isConfigurableLine() && self._isConfigurableProduct()) {
// Leave edit mode of current line if line was configured
// only through the product configurator.
unselectRow();
}
},
ow can I solve this?