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

  • 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.
        }
    })
  • Hello Ash,

    I'm waiting for the day that we'll be able to use Team as condition in the Process Manager :-)  We don't have any custom code in our on-demand installation and have no desire for it.

    I've addressed the need to be able to assign a Team by adding a Territory Code (drop-down) to some Modules, and using that in a process that changes the Team for records.  It's a little cumbersome, but it works until the day we can use the Team field in the process manager.

    I'll attach a screen shot of one of them to show how ugly my process looks :-)  This example assigns the Team when a record is created by someone that isn't in the sales role (the sales rep's default team doesn't need to be changed).

    Best Wishes. 

    Bud Hartley | Cape Foulwind, NZ (and Oregon, USA)

  • Hi Ash,

    It looks like you want TeamX appended to the team set on every new case created. A simple Process that triggers for every new case, like this, can do that:

    These simple processes that run against a high volume of records can very quickly bloat the size of your database and ultimately hurt performance of some features.

    Edit: removed description of a customization that is no longer available.

  • Thanks for adding that great, simple process solution. Regarding using SugarBPM for this and the database size impacts you talked about, what would the "high volume" number be, range-wise or however? Thanks again for sharing! VO