Results 1 to 5 of 5

Thread: one to many relationship

  1. #1
    Animetal is offline Member
    Join Date
    Jul 2007
    Posts
    5

    Default one to many relationship

    I´m trying to get a relationship one to many using the Sugar module builder. I need to do this:

    One account can have many order numbers
    One order number can have only one account

    Just the way how the module CASE work on sugar

    When I build the module and select the relationship relate to: account i can add many accounts to one order number

    I tried avoiding make relationships and use the fileds option relate to: account but I cant find then the subpanel order number in the account module, right now im trying with flex relate but im not sure how that option works.

    Thanks for your time

  2. #2
    dpatech is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    NC
    Posts
    287

    Default Re: one to many relationship

    What you need to do is add a "relate" field for "account_name" to your module. This adds an "account_id" field to your module. When Sugar sees a "relate" field it will add the "SELECT" and "CLEAR" buttons next to the field in your Edit View so you can select the appropriate account. Because you are storing just one account_id per record you get a one-to-many relationship. You can then (manually) define a sub-panel for Accounts to show the related records from your module.
    - Sugar Team
    dpa Technology LLC
    e-mail: dpaDeveloper@dpatechnology.com
    web: http://www.dpatechnology.com

  3. #3
    ptemplin7 is offline Sugar Community Member
    Join Date
    Jun 2007
    Location
    Puget Sound Washington
    Posts
    380

    Default Re: one to many relationship

    Also remember to implement the required vardefs and php fixes documented in the Wiki. It has a great step by step process. But if you don't do this you will be sorry. Look for blnak screens like I have. Still fixing the vardefs.

    see here:
    http://www.sugarcrm.com/wiki/index.p...s_in_Sugar_5.0

    Note make sure any relate fields are set correctly. Including 1-1!

    Paris

  4. #4
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: one to many relationship

    Hi,

    I think you'd find this helpful:
    http://www.sugarcrm.com/forums/showthread.php?t=28679
    What do you think the cookie monster eats ?

  5. #5
    Animetal is offline Member
    Join Date
    Jul 2007
    Posts
    5

    Default Re: one to many relationship

    Thanks for those links, now i can learn more about how to work with my new modules.

    Now after playing with sugar a while I found the module case do almost everything what i want, but i cant find the way how to edit it without changing the main code of the module. What i want is really simple, once you create a case you cant change the case to another account. If I give permission none to Edit in Case I cant create a new Case and if i go to account I still can add Cases to that Account.

    Thanks for your support

    Raul

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
  •