BIG ISSUE : Sugar 7 account_contracts relationship not found

Hello everybody,

I came accross a big issue in my SugarPro 7.5.1.

We did not see it, but it seems that my standard relationship between Accounts and Contracts modules is broken.

I still can see it in Studio > Accounts > relationships : account_contracts is a 1-M relationship. And it is unable to edit or delete it since it's a standard. And I still can see it through Studio > Contracts > relationships  too.

When i am in a Contract record, i'm able to see the Account related. And i'm able to click on it and see the Account record. (so the link in that way is well done)

BUT, when i'm in an Account record, in the Contracts subpanel, the link between the contract and the current account is not done. I can see the contract (name, date etc...) in the subpanel. But i can't click on its name and have a redirection on its record.

AND i've searched in my database, and i have no database named "account_contracts".

i've run several QRR and several "Repair relationships" and nothing did the job...

Please could you help me at least to fix it ? Like i don't know, just recreate a table named "account_contracts", rebuild and Bam get it fixed ?

Thanks a lot, it's a pain in my project !
Parents
  • It does not look like the accounts_contract table is created by default.  The relationship appears to be stored in the contracts table. 

    I've seen this issue before when the link variable is not set to true.  

    Look to see if you have a file at:

    ./custom/modules/Contracts/clients/base/views/subpanel-for-accounts-contracts/subpanel-for-accounts-contracts.php

    Confirm that the file shows a 'link' => true; variable set.

    You will need to run a Quick Repair & Rebuild within Admin > Repairs if you make any changes.

    Hope this helps.
  • Hello loriarce,
    First of all, thanks a lot for your answer, it calmed me a little. :)
    Secondly, yes I see a account_id column in Contracts table => I assume this is rendering the link in the subpanel of Account in a Contract record. But no contract_id in Accounts table, could it be the cause of the nolinking in the subpanel for Contracts in Account Record?

    I've tested to add the 
    'link' => true,
    In the subpanel-for-accounts-contracts.php , and ran a QRR, but there is no change.
    Maybe  i've set it all wrong ?
    Could you enlight me, please?

    Secondly, juste a thought i had when modifying this file : it is generated via the studio's layout. So if i change anything via studio, the file will be overwritten, right? Will i always have to modify it after an edit of subpanel layout ?

    Here is the code of my contracts subpanel in account module, stored in ./custom/modules/Contracts/clients/base/views/subpanel-for-accounts-contracts/subpanel-for-accounts-contracts.php 

    <?php
    // created: 2015-07-07 00:52:06
    $viewdefs['Contracts']['base']['view']['subpanel-for-accounts-contracts'] = array (
      'type' => 'subpanel-list',
      'link' => true,
      'panels' => 
      array (
        0 => 
        array (
          'name' => 'panel_header',
          'label' => 'LBL_PANEL_1',
          'fields' => 
          array (
            0 => 
            array (
              'name' => 'name',
              'label' => 'LBL_CONTRACT_NAME',
              'enabled' => true,
              'default' => true,
            ),
            1 => 
            array (
              'name' => 'type_offre_c',
              'label' => 'LBL_TYPE_OFFRE',
              'enabled' => true,
              'default' => true,
            ),
            2 => 
            array (
              'name' => 'produit_c',
              'label' => 'LBL_PRODUIT',
              'enabled' => true,
              'default' => true,
            ),
            3 => 
            array (
              'name' => 'situation_contrat_c',
              'label' => 'LBL_SITUATION_CONTRAT',
              'enabled' => true,
              'default' => true,
            ),
            4 => 
            array (
              'name' => 'modele_c',
              'label' => 'LBL_MODELE',
              'enabled' => true,
              'default' => true,
            ),
            5 => 
            array (
              'name' => 'immatriculation_c',
              'label' => 'LBL_IMMATRICULATION',
              'enabled' => true,
              'default' => true,
            ),
            6 => 
            array (
              'name' => 'ville_mrh_c',
              'label' => 'LBL_VILLE_MRH',
              'enabled' => true,
              'default' => true,
            ),
          ),
        ),
      ),
    );

    Thanks a lot for your kind help !
Reply
  • Hello loriarce,
    First of all, thanks a lot for your answer, it calmed me a little. :)
    Secondly, yes I see a account_id column in Contracts table => I assume this is rendering the link in the subpanel of Account in a Contract record. But no contract_id in Accounts table, could it be the cause of the nolinking in the subpanel for Contracts in Account Record?

    I've tested to add the 
    'link' => true,
    In the subpanel-for-accounts-contracts.php , and ran a QRR, but there is no change.
    Maybe  i've set it all wrong ?
    Could you enlight me, please?

    Secondly, juste a thought i had when modifying this file : it is generated via the studio's layout. So if i change anything via studio, the file will be overwritten, right? Will i always have to modify it after an edit of subpanel layout ?

    Here is the code of my contracts subpanel in account module, stored in ./custom/modules/Contracts/clients/base/views/subpanel-for-accounts-contracts/subpanel-for-accounts-contracts.php 

    <?php
    // created: 2015-07-07 00:52:06
    $viewdefs['Contracts']['base']['view']['subpanel-for-accounts-contracts'] = array (
      'type' => 'subpanel-list',
      'link' => true,
      'panels' => 
      array (
        0 => 
        array (
          'name' => 'panel_header',
          'label' => 'LBL_PANEL_1',
          'fields' => 
          array (
            0 => 
            array (
              'name' => 'name',
              'label' => 'LBL_CONTRACT_NAME',
              'enabled' => true,
              'default' => true,
            ),
            1 => 
            array (
              'name' => 'type_offre_c',
              'label' => 'LBL_TYPE_OFFRE',
              'enabled' => true,
              'default' => true,
            ),
            2 => 
            array (
              'name' => 'produit_c',
              'label' => 'LBL_PRODUIT',
              'enabled' => true,
              'default' => true,
            ),
            3 => 
            array (
              'name' => 'situation_contrat_c',
              'label' => 'LBL_SITUATION_CONTRAT',
              'enabled' => true,
              'default' => true,
            ),
            4 => 
            array (
              'name' => 'modele_c',
              'label' => 'LBL_MODELE',
              'enabled' => true,
              'default' => true,
            ),
            5 => 
            array (
              'name' => 'immatriculation_c',
              'label' => 'LBL_IMMATRICULATION',
              'enabled' => true,
              'default' => true,
            ),
            6 => 
            array (
              'name' => 'ville_mrh_c',
              'label' => 'LBL_VILLE_MRH',
              'enabled' => true,
              'default' => true,
            ),
          ),
        ),
      ),
    );

    Thanks a lot for your kind help !
Children
No Data