Hello,
I'm trying to set up a new button in Account/view/
to create a new contact in Full-Edit-View.
Can anyone help me?
I'm trying to set up a new button in Account/view/
to create a new contact in Full-Edit-View.
Can anyone help me?
{
"menu": {
"detail": {
"buttons": [
"__APPEND__",
{
"label": "createContact",
"name": "newContact",
"action": "newContact",
"style": "primary",
"acl": "create",
"aclScope": "Contact",
"handler": "custom:contact-handler",
"initFunction": "initNewContact",
"actionFunction": "newContact",
"checkVisibilityFunction": "isNewContactVisible"
}
]
}
}
}
define('custom:contact-handler', ['action-handler'], (Dep) => {
return class extends Dep {
initNewContact() {}
newContact(data, e) {
const attributes = {
accountId: this.view.model.get('id'),
accountName: this.view.model.get('name'),
};
this.view.getRouter().dispatch('Contact', 'create', { attributes });
}
isNewContactVisible() {
return true;
}
};
});
Comment