AnsweredAssumed Answered

Override prefill value before create case via js from create view

Question asked by Autchara Chaiprom on Jul 6, 2017
Latest reply on Jul 6, 2017 by André Lopes

Hi

 

I tried to create case from my custom button in subpanel-list

after click a button, a drawer will expand but I cannot prefill some value for example assigned_user_id, team_set_id,team_id but for some fields it work properly example: name, status, description.

 

./custom/modules/Emails/clients/base/views/subpanel-list/subpanel-list.js

openSelectDrawer: function(event,email_name,team_id,team_set_id) {
  console.log('-- openSelectDrawer --');
  var self = this;
    var modelPrefil = app.data.createBean("Cases");
    modelPrefil.set({
            name: email_name,
            status: 'Closed',
            description: 'test',
            assigned_user_id: '1',
            team_id: team_id,
            team_set_id: team_set_id,
    });
    self.drawer = app.drawer.open({
                layout: "create",
                context:{
                    create: true,
                    model: modelPrefil
                }

            }, function(){
                console.log("After save", arguments);
            });

            app.once("app:view:change", function(name, attributes){
            console.log('After drawer display');
        });
},

 

Who has any idea to override this values ?

Please suggest me.

 

SugarPro 7.8.2.0

 

Thanks,

M

Outcomes