How to Assign a Specific Team For Specific Module When Create A Record

How to add specific team for cases module when create a new record 

Ex: I have created a X team. and i want to add this team when a user create a new record in cases module ( This team should add only for cases module )

Alex NassiHarald Kuskehats

Parents
  • An easy way would be to extend the create.js file of the module in question. You can introduce new variables just before the saving function is called. I have done a similar thing for another module.

    That is, create a new file: <sugar folder>/custom/modules/<module>/clients/base/views/create/create.js

    ({
        extendsFrom: 'CreateView',
        initialize: function(options) {
            this._super('initialize', [options]);
        },

        saveModel: function(success, error) {

            var custom_success = function() {

                this.save_override(arguments)
                success(arguments);
            };

            custom_success = _.bind(custom_success , this);


            this._super('saveModel', [custom_success, error]);
        },

        save_override: function() {
          //add the things you want to be saved here, you can also use $.ajax() here to make calls to the API, can be useful if you need to save something to an external database etc.
        }
    })
Reply
  • An easy way would be to extend the create.js file of the module in question. You can introduce new variables just before the saving function is called. I have done a similar thing for another module.

    That is, create a new file: <sugar folder>/custom/modules/<module>/clients/base/views/create/create.js

    ({
        extendsFrom: 'CreateView',
        initialize: function(options) {
            this._super('initialize', [options]);
        },

        saveModel: function(success, error) {

            var custom_success = function() {

                this.save_override(arguments)
                success(arguments);
            };

            custom_success = _.bind(custom_success , this);


            this._super('saveModel', [custom_success, error]);
        },

        save_override: function() {
          //add the things you want to be saved here, you can also use $.ajax() here to make calls to the API, can be useful if you need to save something to an external database etc.
        }
    })
Children
No Data