I have created a custom button in contact and trying to call ajax on click event but not getting any response.
Espo.define('custom:views/contact/detail', 'views/detail', function(Dep){
return Dep.extend({
setup: function(){
Dep.prototype.setup.call(this);
this.addMenuItem('buttons', {
name: 'DocStatus',
label: 'Doc Status',
style: 'primary',
acl: 'edit',
action: 'GetDocStatus'
}, true);
},
actionGetDocStatus: function(){
this.notify('Wait... fatching the document status.');
var url = 'https://ipinfo.io/json';
var data = '';
var options = '';
Espo.Ajax.getRequest(url)
.then(response => {
console.log(response);
})
.catch(xhr => {});
}
});
})
Above link in working and giving output in postman and there in EspoCRM Error 404 is showing.
Please help me on this one, Any help is appreciated, Thanks in Advance
Espo.define('custom:views/contact/detail', 'views/detail', function(Dep){
return Dep.extend({
setup: function(){
Dep.prototype.setup.call(this);
this.addMenuItem('buttons', {
name: 'DocStatus',
label: 'Doc Status',
style: 'primary',
acl: 'edit',
action: 'GetDocStatus'
}, true);
},
actionGetDocStatus: function(){
this.notify('Wait... fatching the document status.');
var url = 'https://ipinfo.io/json';
var data = '';
var options = '';
Espo.Ajax.getRequest(url)
.then(response => {
console.log(response);
})
.catch(xhr => {});
}
});
})
Above link in working and giving output in postman and there in EspoCRM Error 404 is showing.
Please help me on this one, Any help is appreciated, Thanks in Advance
Comment