Remove Global Team from all the modules

Hello Everyone,

I am working on SugarCRM Enterprise, Version 9.2.0-dev.1 (Build 120) (Fall '19).

I have to remove Global team from all the records which I have in SugarCRM all modules.

Earlier I was thinking about deleting team id of Global Team (i.e. 1) from team_sets_teams table. But it sounds bad idea.

Because, Global team may be the primary team of any record so $bean->team_id contains the id of Global team.

Currently I don't have any idea how to deal with this. Any help is highly appreciated.

Thanks.

Parents Reply Children
  • If you will delete the ID of Global then it will also create the problem regardless it is already used as a primary or secondary team in the record.

  • Hi Maryam Aslam,

    Thanks for the quick reply.

    The same thing I was thinking about. For example.

    Delete all occurrences of Global Team from team_sets_teams table.

    UPDATE team_sets_teams SET deleted = 1 WHERE team_id = '1'

    Set all team_id as blank in module table.

    UPDATE accounts SET team_id = '' WHERE id = '934e6d46-xxxx-xxxx-xxxx-00155d640fc2'.

    But this not did the trick.

    I am still receiving response like this.

    {
        "id": "934e6d46-xxxx-xxxx-xxxx-00155d640fc2",
        "date_modified": "2020-02-07T17:36:47+05:30",
        "annual_revenue": "",
        "locked_fields": [],
        "team_name": [
            {
                "id": "1",
                "name": "Global",
                "name_2": "",
                "primary": false,
                "selected": false
            },
            {
                "id": "40ba2fd6-xxxx-xxxx-xxxx-00155d640fc2",
                "name": "Team B",
                "name_2": "",
                "primary": false,
                "selected": false
            }
        ],
        "_acl": {
            "fields": {}
        },
        "_erased_fields": [],
        "_module": "Accounts"
    }

    Anything I am missing here?

    Do we have any other and better approach than this? Always welcome.