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.
  • I'm answering my own question with the really kind and reassuring help of loriarce and Shijin Krishna !

    Here is the full / synthetic answer :

    There is no account_contracts table created for the relationship. It is in fact stored in the contracts table under the column account_id.

    To enable the link to the Contracts subpanel in Accounts, first generate the file ./custom/modules/Contracts/clients/base/views/subpanel-for-accounts-contracts/subpanel-for-accounts-contracts.php  by going to Admin>Studio>Acocunts>subpanels>contracts  and save and deploy this view.

    Then, in the subpanel-for-accounts-contracts.php, you'll have the fields visible for this layout. Chose the one you want (but the name field is better generally) and set it like that :
    0 => 
    array (
              'name' => 'name',
              'label' => 'LBL_CONTRACT_NAME',
              'enabled' => true,
              'default' => true,            'link' => true,
            ), 
     
    Then, go to admin > repair > quick repair and rebuild.

    But, be carefull : because this file is generated when changing the view, i don't know if your change will last for ever.

    So, again, thanks a lot to the kind loriarce and Shijin Krishna : they have been very helpful and kind and reassuring me with the big fuss i made out of this problem ! :)
Reply
  • I'm answering my own question with the really kind and reassuring help of loriarce and Shijin Krishna !

    Here is the full / synthetic answer :

    There is no account_contracts table created for the relationship. It is in fact stored in the contracts table under the column account_id.

    To enable the link to the Contracts subpanel in Accounts, first generate the file ./custom/modules/Contracts/clients/base/views/subpanel-for-accounts-contracts/subpanel-for-accounts-contracts.php  by going to Admin>Studio>Acocunts>subpanels>contracts  and save and deploy this view.

    Then, in the subpanel-for-accounts-contracts.php, you'll have the fields visible for this layout. Chose the one you want (but the name field is better generally) and set it like that :
    0 => 
    array (
              'name' => 'name',
              'label' => 'LBL_CONTRACT_NAME',
              'enabled' => true,
              'default' => true,            'link' => true,
            ), 
     
    Then, go to admin > repair > quick repair and rebuild.

    But, be carefull : because this file is generated when changing the view, i don't know if your change will last for ever.

    So, again, thanks a lot to the kind loriarce and Shijin Krishna : they have been very helpful and kind and reassuring me with the big fuss i made out of this problem ! :)
Children