How to show message from after save logichook in sugarcrm 7.9

I have logichook aftersave, and in this I have send data to my api and based on api response I want to show message in SugarCRM 7.9. How can I achive this.

I have think to replace logichook with endpoint but in create.js I did not get record_id.

I have tried to custom/modules/Accounts/clients/base/views/create/create.js

({
extendsFrom: 'CreateView',
initialize: function (options) {
this._super('initialize', [options]);
this.context.on('button:save_button:click', this._save_desc, this);
},
_save_desc: function (model) {
   var id = this.model.get('id');
   var name = this.model.get('name');
   console.log('record_id='+id);
   console.log('name='+name);
},
})

This give me name but id is undefined. If this work then I will send id to my endpoint and according to endpoint response I can able to show alert message. In logichook alert message is not working. Please give me in this problem.

Parents
  • A new Sugar record does not get a record ID until after it has been saved to the Sugar server. When you click "Save" the request is only just then sent to server. You have to wait for the response to get the new record ID. You really want a callback on the model save request not the button click event. 

    Look at CreateView's saveModel() function.

    App Ecosystem @ SugarCRM

Reply
  • A new Sugar record does not get a record ID until after it has been saved to the Sugar server. When you click "Save" the request is only just then sent to server. You have to wait for the response to get the new record ID. You really want a callback on the model save request not the button click event. 

    Look at CreateView's saveModel() function.

    App Ecosystem @ SugarCRM

Children