AnsweredAssumed Answered

Calling email compose drawer after saving a quote

Question asked by Abhilash V on Mar 30, 2016

Hello

 

I need to trigger the email composer drawer after a Quote has been saved.

This is the script I am using:

        var app = parent.SUGAR.App;

        var model = app.controller.context.get('model');

        var shareField = app.view.createField({

            def: {

                type: 'shareaction'

            },

            module: 'Quotes',

            model: app.data.createBean('Quotes', {

                id: model.get('id'),

                name: model.get('name')

            }),

            view: app.view.createView({})

        });

        shareField.setExtraOptions(

            {

                parent_type: 'Quotes',

                parent_id: model.get('id'),

                parent_name: model.get('name')

            }

        );

        shareField.shareWithSugarEmailClient();

 

I tried calling this is in the edit view and detail view of Quotes. But it doesnot work the first time the Quote is saved. It just disappears immediately after the page is loaded. But its working if we refresh the page again.

Anyone had any luck trying this ?

Outcomes