Francesca Shiekh

How can I open an email draft in a compose drawer?

Discussion created by Francesca Shiekh on Mar 9, 2015
Latest reply on Apr 18, 2018 by Francesca Shiekh
In the Email subpanel on Cases I have a custom reply button which when clicked opens a compose Email drawer and prepopulates to/from/body(quoting the original email).

The pre-populated items are retrieved via a custom API call when the customemailreply is fired:

               
        App.api.call('GET', url, '',{
          success: _.bind(function(o){
            app.drawer.open({
              layout:'compose',
              context:{
                create: true,
                prepopulate: o ,
                module:'Emails',
              }
            });
          }, this),
          error: _.bind(function(o){
            console.log(o);
          }, this),
        });
                             
This works fine but if in the drawer I "Save Draft" when I click the custom reply button I want to open the same drawer pre-populated with the draft (same ID and all) and I can't seem to get that to work for Email the way it worked for another module (see SugarCRM 7.5.0.1 how do I open app drawer with full edit from subpanel? )

I am using:

      if(emailType == 'draft'){
        //editing a draft
        //open the drawer with the email  as was when last saved
        console.log(replyToEmailBean.attributes);
        app.drawer.open({
          layout:'compose',
          context:{
            create: true,
            model: self.model,
            module:self.module,
          }
        });
   }

thanks,
FrancescaS

Outcomes