js code is working on custom module's record view but not working on create and quick create view

HI All,

Please review below js code is working on custom module's record view but not working on create and quick create view:

"({
extendsFrom: 'RecordView',

/**
* @inheritdoc
*/
initialize: function(options) {
this._super('initialize', [options]);
this.model.on("change:field_name", this.set_custom_field, this);
},
_render: function() {
alert("inside render.....");
this._super('_render');
//added call to autofill on quickcreate view of custom module  subpanel on accounts record view
this.set_custom_field();
},
set_custom_field: function(){
var account_name = this.model.get('relatinship_ida');//get account id
var _self=this;//obj of this
var account_bean = app.data.createBean('Accounts',{id: account_name});
account_bean.fetch({
success: function (data) {
if(data.attributes.avds_families_accounts_1avds_families_ida != undefined){
 alert("test data")
}

},
error: function(error) {
console.log(error);
}
});
}


})

"

Note : I don't have any create folder inside custom/module/module_name/clients/base/views/create, only I have is record folder and record.js file

Kindest Regards,

Shreya

Parents
  • To have a controller on the create view you need to have a create.js controller, the create inherits the record.php for the view but will not execute the record controller. So you do need a separate controller in custom/module/module_name/clients/base/views/create/create.js which will extendFrom: 'CreateView'.
    Having said that it is not clear to me what you are trying to achieve.

    FrancescaS

Reply
  • To have a controller on the create view you need to have a create.js controller, the create inherits the record.php for the view but will not execute the record controller. So you do need a separate controller in custom/module/module_name/clients/base/views/create/create.js which will extendFrom: 'CreateView'.
    Having said that it is not clear to me what you are trying to achieve.

    FrancescaS

Children
No Data