Show alert massage after record save

Hi There,

I am looking to trigger alert box after record save at record creations time.

elf.initiateSave(_.bind(function initSave() {
                    if (self.closestComponent('drawer')) {
                        app.alert.show('or_copied123', {
                            level: 'success',
                            messages: 'this the message',
                            autoClose: false
                        });
                        app.drawer.close(self.context, self.model);
                        app.alert.dismiss('or_copied123');
                    }
                }, self));
I tried 'saveAndClose': function()  in create js but it't not working.  Please suggest me any way to achieve this. is there any way to show alert message showing only after the record save.  
  • Hi Sandeep,

    Did you tried calling the function after save button click as mentioned below. If not can you please try using as below by placing your function name in place of saveClicked in the below line.

    this.context.on('button:save_button:click', this.saveClicked, this);
    And please go through this link to know more about Alerts in SugarCRM.
    Hope this information helps you.:)
    Thanks and Best Regards,
    PK,
    www.bhea.com
  • There already is a message when the create record is successful. 


    If you look at 

    clients/base/views/create/create.js

    you will see that the createRecordWaterfall uses the buildSuccessMessage to show that the record was successfully created.

    You could see if you can extend the create.js controller for your module and leverage the buildSuccessMessage function to customize your message.

    FrancescaS