Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: How to remove a custom relationship

  1. #1
    pbthenick is offline Junior Member
    Join Date
    Aug 2008
    Posts
    3

    Default How to remove a custom relationship

    Hello,

    I have been testing the latest version of sugarcrm with my company's data for a few weeks. Recently I added a relationship with which I can't find a way to remove.

    Does anybody know how to remove it either through the UI or manually? Thank you in advance for any help one can offer.

    Regards,
    pbthenick

    Sugar 5.1
    Win 2003 32bit
    5.2.6 php
    Sql Server Express 2005
    Apache 2.0

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: How to remove a custom relationship

    Hi pbthenick

    You need to:
    1. remove the field in the vardefs which points to that relationship;
    2. remove the relationship itself from the metadata folder, if exists or from the vardefs;
    3. Rebuild Extension and Rebuild Relationship

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    pbthenick is offline Junior Member
    Join Date
    Aug 2008
    Posts
    3

    Thumbs up Re: How to remove a custom relationship

    André,

    Thank you very much. Your instructions solved my problem.


    Regards,
    pbthenick

  4. #4
    clayreiche is offline Junior Member
    Join Date
    Nov 2008
    Posts
    2

    Default Re: How to remove a custom relationship

    Can you explain in detail how to do this? Every time I manually modify lines from (seemingly) ANY file, a rebuild puts the files back!!! I'm very frustrated at the moment. I'm using Version 5.1.0b (Build 4905). I've created a custom module, and then created a one-to-many relationship to it with "Contacts" as the primary module. Doesn't appear to be any way to remove the relationship in the gui... I thought I followed your directions above but once I did the rebuild(s), the files went back to original versions...

    I had modified some listviewdefs also and the files disappeared on a rebuild.... just seems like the rebuilds are killing me. I've wasted a lot of time modifying views to then have them blown away after a rebuild...

    Thanks for your help in understanding how this all works.

    Clay

  5. #5
    eNick is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    UK
    Posts
    282

    Default Re: How to remove a custom relationship

    Just one quick point on this...

    Never, never, ever "play" with module builder or studio on your live system! Especially, without taking a backup - of both the database and the code.

    If you don't know how to take (and restore) a full backup or create a cloned playpit you probably shouldn't be making these kinds of changes.

    You have the potential to seriously damage your system and possibly lose access to your customer data. At best, you'll end up having to pay a company like ours to sort your mess out before your boss discovers what you've done.

    It's going to be a horrible sickening feeling in your stomach when you realise you've just broke your system.
    T H E S U G A R R E F I N E R Y
    : : : SugarCrm Customisation and Integration Services : : :

    SugarCRM Systems Integration Partner
    Trusted with SugarCRM
    http://www.theSugarRefinery.com ::: sales@{removethis}theSugarRefinery.com

  6. #6
    clayreiche is offline Junior Member
    Join Date
    Nov 2008
    Posts
    2

    Default Re: How to remove a custom relationship

    Thanks for the lesson eNick. Not a production system, I'm evaluating and comparing to Salesforce.com. Instead of taking the time to scold, it would have been nice for you to help me with my problem...

    Clay

  7. #7
    LucioFiamingo is offline Sugar Community Member
    Join Date
    Jul 2009
    Posts
    29

    Default Re: How to remove a custom relationship

    Hi, I'm new in sugarcrm and I'd like to know how to remove a relationship. I.e. :


    1. remove the field in the vardefs which points to that relationship;
    2. remove the relationship itself from the metadata folder, if exists or from the vardefs;
    3. Rebuild Extension and Rebuild Relationship

    Could you explain how to do this steps??

    Thanks

  8. #8
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: How to remove a custom relationship

    Quote Originally Posted by LucioFiamingo View Post
    Hi, I'm new in sugarcrm and I'd like to know how to remove a relationship. I.e. :


    1. remove the field in the vardefs which points to that relationship;
    2. remove the relationship itself from the metadata folder, if exists or from the vardefs;
    3. Rebuild Extension and Rebuild Relationship

    Could you explain how to do this steps??

    Thanks
    When you create a new relationship through Admin -> Studio -> <Module Name> -> Relationships, Sugar create several files at custom folders:

    Left Side Hand Relationship (module from which you created the relationship):
    custom/Extension/modules/<ModuleName>/Ext/Vardefs/<relationship_name>.php
    custom/Extension/modules/<ModuleName>/Ext/Layoutdefs/<relationship_name>.php
    custom/Extension/modules/<ModuleName>/Ext/Language/<relationship_name>.php

    Right Side Hand Relationship:
    custom/Extension/modules/<ModuleName>/Ext/Vardefs/<relationship_name>.php
    custom/Extension/modules/<ModuleName>/Ext/Language/<relationship_name>.php

    Relationship itself:
    custom/metadata/<relationship_name>Meta.php

    Table Dictionary:
    custom/Extension/application/Ext/TableDictionary/<relationship_name>.php

    After removing all these files you should need to go to Admin -> Repair -> Quick Repair and Rebuild

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  9. #9
    analyst123 is offline Member
    Join Date
    Jun 2009
    Posts
    17

    Default Re: How to remove a custom relationship

    also you have to edit /sugar/custom/application/Ext/TableDictionary/tabledictionary.ext.php file and delete

    include('custom/metadata/<relationship_name>.php');

  10. #10
    davidmmulder is offline Member
    Join Date
    Feb 2010
    Posts
    7

    Default Re: How to remove a custom relationship

    This doesn't work (at least in 5.1.0b). It just crashed both modules in the relationship (giving a MySQL error of some sort). I restored from backup and it's just fine, but I would like to know how to actually remove a relationship. Why are relationships permanent if you add them in the Studio? There aught to be an option to remove them.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. upgraded to 4.5.1e, received "Metadata for table tracker does not exist"
    By sfgeorge in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2007-09-03, 02:24 PM
  2. Asterisk Patch 1.1.0 Crash on logon
    By skyracer in forum Help
    Replies: 6
    Last Post: 2006-07-08, 06:30 AM
  3. Replies: 7
    Last Post: 2006-06-06, 07:56 PM
  4. 4.0.1 Installation Problem
    By clawton in forum Help
    Replies: 14
    Last Post: 2006-02-13, 04:17 PM
  5. Query erro after 4.0 upgrade
    By ldebernardini in forum Help
    Replies: 20
    Last Post: 2006-01-13, 05:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •