Mass update function for Team-based Permissions

Hi everybody, 

I'm looking to mass udapte the "Additional permissions" on around 1200 records (for exemple, Accounts).

Doing it manually via the button would be extremely time-consuming...

I could'n find out how to update via import. We only have 3 options : 

Do you have any solution to this ? 

Thanks in advance and Have a good day, Slight smile

Parents
  • Hi  ,

    You should be able to use the Mass Update operation from the list view action menu to modify the team-based permissions. Mass Update is limited to 1,000 record batches if you are hosted in SugarCloud, so it would require two batch updates to complete. When performing a mass update, you can modify the teams and permissions like the following:

    Chris

  • Oh Thanks a lot for the advice ! 

    I was able to update the 1000 records first !

    Now, what's the best way to identify the 200 remaining records that still need to be updated ? 

    Thanks in advance Chris Slight smile

  • Hi Phuong,

    Assuming none of the remaining records were modified today by a user or another process, create a list view filter to return any records modified before today and that should give you the remaining records. If there were some modified today, just sort the list by date modified in ascending order and select the remaining ~200 records by page until you get to the records you modified via mass update.

    Chris

  • Hi  ,

    I've another question. In my case. After mass updating a set of accounts, I now need to mass update the team-based permissions for all the contacts associated to theses accounts. 

    I tried to update the contacts from the Contacts module list view as you showed me before, but I'm having difficulty.

    Here are the steps I took:

    Step 1 : I went to the Contacts module and created a filter based on Account.

    Step 2 :I tried to select all accounts where the "Postal Code" starts with '13'. However, the list view only allows me to select 20 accounts at a time, but my filter returns 1272 accounts.

    Do you have any suggestions on how I can apply the team update to all these contacts at once?

    Thanks,
    Phuong

  • Hi  ,

    My recommendation is to create a summation report on the Contacts module with the desired filter criteria. Sugar reports that have chart components (summation, summation with details, and matrix reports) have the ability to click into the chart results and perform mass updates. 

    In the report creation, make sure you include a filter that will remove the record from the report once you perform the necessary update (e.g. date modified is before today). In addition to the filters, choose a group by option that, if possible, would include all the contacts you want to update under a single grouping. If that isn't possible, choose an option that will produce as few groupings as possible (e.g. year of the contact date created, country of the related account, etc.). Once you have a grouping selected, you will need to select a chart to visualize the results. The pie chart is my preference for this sort of operation. 

    Once you have the chart saved, click into one of the chart sections which will give you a drawer listing the contacts in that grouping. Select up to 1,000 records and perform your mass update. Once the mass update completes, refresh the chart results and keep going until the report returns 0 results. 

    I hope that helps!

    Chris

  • Hi Chris !

    Amazing, it's an excellent idea ! I could not come with this idea by myself.

    By the way, is it possible to do it via request SQL ?

    Thanks a lot !

    Phuong

Reply Children
  • Hi  ,

    Yes, this operation is possible via SQL as well. If you want the contacts to inherit the team permissions of their parent account, then the following query should accomplish what you need:

    UPDATE contacts c 
        INNER JOIN 
            accounts_contacts ac 
            ON c.id = ac.contact_id 
        INNER JOIN 
            accounts a 
            ON ac.account_id = a.id 
        SET 
            c.team_id = a.team_id, 
            c.team_set_id = a.team_set_id, 
            c.acl_team_set_id = a.acl_team_set_id 
        WHERE 
            c.deleted = 0 
            AND ac.deleted = 0 
            AND a.deleted = 0 
            AND a.billing_address_postalcode LIKE '13%';

    In the above query, team_id is the primary team on the record, team_set_id is the collection of teams on the record, and acl_team_set_id is the collection of teams that have access to modify the record. I'm assuming your postal code field is the billing_address_postalcode but you may want to change it to shipping_address_postalcode or have an OR clause for that condition to check both fields depending on how you store addresses in the account module.

    Since you're running in SugarCloud, you will need to provide this query to Sugar Support.

    If you want newly created contacts to inherit the team permissions from their associated account or for contacts to keep updated when permissions change on the parent account, our Upsert BPM Essentials plugin includes an 'Inherit Teams' action that you can include in a BPM process to ensure that data always stays consistent. Contact us via our site if you would like a demo as the plugin has a lot of other great features if you leverage BPM to automate your business.

    Chris