Why are changes to Teams not taking in Quotes?

Hi all, 

i am using SugarCRM pro 6.5.18 and I have a problem when I try to set Global as team for a quote, when I click "save", the record is saved but no changes are made to teams. (all other changes are saved)

Even if I only add the Global team, if I set it as primary etc (tried all options).

The problem only shows on quotes module, all other modules are ok.

Trying to debug the issue, i noticed that the value is sent correctly between all other parameters.

Any suggestion?
  • 1) See SugarLog (or php error log)

    2) Try to rebuild Teams (Admin->Repair->Repair Teams)

  • Hi Roman,

    ty for your reply

    i found this on sugarcrm.log: [FATAL] failed to find link for quotes_teams

    tried to rebuild teams but nothing changed....

    modified log level to DEBUG and the strange thing i see is that first it makes the correct call:

    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Hook called: Quotes::after_retrieve
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] SugarBean
    .load_relationships, Loading relationship (teams).
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Link Constructor, relationship name: quotes_teams
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Link Constructor, Table name:
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Link Constructor, Key name:
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Link Constructor, _bean_table_name: quotes
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Link Constructor, _bean_key_name: team_set_id
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Link Constructor, relationship record found.
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][INFO] Query:SELECT team_memberships.id FROM team_memberships WHERE user_id='a87f0bf4-8595-0713-abf3-52d919ec060f' AND team_id IN ('b3167858-341f-e2b0-85fb-52d91923444c','9f56649d-b59c-8a82-8fa6-529374e3889a') AND team_memberships.deleted = 0
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][INFO] Query Execution Time:0.00075197219848633
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][INFO] Query:UPDATE quotes SET team_set_id = '42755275-0f5c-7aed-3626-565419eb6690' WHERE id = 'ee92bed2-f3b9-5233-b08b-563222f342d0'
    Tue Nov 24 09:34:50 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][INFO] Query Execution Time:0.0066819190979004

    but after that call, another update is executed on same record, deleting the modifications

    Tue Nov 24 09:34:51 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Hook called: Users::after_retrieve
    Tue Nov 24 09:34:51 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Retrieve Team: SELECT teams.* FROM teams  WHERE associated_user_id = 'a87f0bf4-8595-0713-abf3-52d919ec060f' AND deleted=0
    Tue Nov 24 09:34:51 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] Limit Query:SELECT teams.* FROM teams  WHERE associated_user_id = 'a87f0bf4-8595-0713-abf3-52d919ec060f' AND deleted=0 Start: 0 count: 1
    Tue Nov 24 09:34:51 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][INFO] Query:SELECT teams.* FROM teams  WHERE associated_user_id = 'a87f0bf4-8595-0713-abf3-52d919ec060f' AND deleted=0 LIMIT 0,1
    Tue Nov 24 09:34:51 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][INFO] Query Execution Time:0.0003969669342041
    Tue Nov 24 09:34:51 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][DEBUG] SugarBean
    .load_relationships, Loading relationship (teams).
    Tue Nov 24 09:34:51 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][INFO] Query:SELECT team_memberships.id FROM team_memberships WHERE user_id='a87f0bf4-8595-0713-abf3-52d919ec060f' AND team_id IN ('b3167858-341f-e2b0-85fb-52d91923444c') AND team_memberships.deleted = 0
    Tue Nov 24 09:34:51 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][INFO] Query Execution Time:0.00044393539428711
    Tue Nov 24 09:34:51 2015 [5940][a87f0bf4-8595-0713-abf3-52d919ec060f][INFO] Query:UPDATE quotes SET team_set_id = 'b3167858-341f-e2b0-85fb-52d91923444c' WHERE id = 'ee92bed2-f3b9-5233-b08b-563222f342d0'

    As u can see it is executed one second after the first, on the same instance... and is resetting the previous (correct) update...

  • 1) Try to Rebuild Relationships

    2) See logic hooks in custom/modules/Quotes/logic_hooks.php

  • U're the man!

    logic hooks in custom/modules/Quotes/logic_hooks.php were added by an external agency... and was resetting the Team to the private team of the current user...

    Ty again for your time and for pointing me to the right direction!!