Results 1 to 7 of 7

Thread: Create an association between 2 modules

  1. #1
    ChocolateLover is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    14

    Default Create an association between 2 modules

    I'm using Sugar 6.0.2

    I've worked out how to create new modules and relationships between them.

    I want to record the software modules that customers have subscribed to.

    I'm using the Accounts module for my customers.

    I've created a new module that holds a list (name only) of the software modules available.

    I've created the relationship
    Primary module - Customers
    Type - Many to Many
    Related module - SoftwareModules

    I just want to be able to create an association between the Customer and the Software Module, but the record won't contain any additional data, such as a name field which seems to be compulsory.

    The way I would see this working is to be presented with a pulldown list of Software Modules in the Software Modules sub panel from Customers. A new record would be created for each Software Module that the Customer subscribes to.

    Can anyone tell me if this is possible, or point me to a workaround please.

    Any help is appreciated, thanks.

  2. #2
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: Create an association between 2 modules

    Why don't you remove all the fields from editview then from your software module if you don't need anything except one field then (dropdown)?

    You can remove name field, it ain't mandatory, and also customize the fields shown on subpanel to show only the field you left.
    CRM Software Engineer
    Eontek - www.eontek.rs

  3. #3
    ChocolateLover is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    14

    Default Re: Create an association between 2 modules

    Thanks, but I don't think that will work.

    My SoftwareModules has been populated - I'm not trying to create a Software Module record and relate it to Customers, like I would with a Contact for example, but to link an existing Software Module record to Customers.

    I think I need a second module - SoftwareModules to Customers - to hold the relationship. I've tried this, created a related field associated to SoftwareModules and removed all other fields from the view, but I get the message
    Are you sure you wish to continue? The following required fields are missing from the layout: "name"
    which suggests that the name field is required.

  4. #4
    robertbmirth is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Irvine, CA
    Posts
    345

    Default Re: Create an association between 2 modules

    I'm not entirely sure why you want to create a record with no data, but if you go into the vardefs.php of the module you should be able to modify any required fields and set their values to false. You'll possibly also have to modify the line
    PHP Code:
    VardefManager::createVardef('mirth_Training','mirth_Training', array('basic','team_security','assignable')); 
    if the fields in question are part of the templates in the array of this line rather than explicitly defined. Note that you may also have to do this for other metadata files such as editviewdefs.php and modify their required values as well. Lastly, you'll have to do a repair/rebuild.
    Robert Beckman
    Software Engineer
    Mirth Corporation

  5. #5
    ChocolateLover is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    14

    Default Re: Create an association between 2 modules

    Thanks, I'll have a look at this.

    I don't want to create a record with no data. Looking at this from a database point of view, I'd have a table for Customers and a table for SoftwareModules. I'd maintain my list of let's say 10 SoftwareModules, but I'd also need a CustomersToSoftwareModules table that would just hold the customer id and the module id.

    To clarify, I just want to link existing SoftwareModules records to my Customer records. All the info I need is in the existing tables - my customer info and software module info, so the only data I need in the CustomersToSoftwareModules table would be the customer id and the module id to create the association.

    Mentally, I've been trying to fit it into the same scenario as say linking Contacts to Accounts, but the difference is that I don't need to create the SoftwareModule record as it already exists, I just need to associate the SoftwareModules record to the Customer/Account.

  6. #6
    robertbmirth is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Irvine, CA
    Posts
    345

    Default Re: Create an association between 2 modules

    I don't remember if this is in CE or not (I'm on Pro) but It sounds more like you're doing the relationship that the products module has to quotes. Its actually a 3 module relationship - there's the Product Catalog, which contains one entry for every product type, then the Products module which instantiates an entry from the product catalog every time its referenced in the quotes module.
    Robert Beckman
    Software Engineer
    Mirth Corporation

  7. #7
    ChocolateLover is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    14

    Default Re: Create an association between 2 modules

    Ok, I'll look at that.

    Thanks very much for your help.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. logic hook event for create association
    By cawkie in forum Developer Help
    Replies: 4
    Last Post: 2010-06-22, 06:44 PM
  2. Auto Email Association - Need Help!
    By starzasu in forum Developer Help
    Replies: 0
    Last Post: 2010-04-30, 09:53 PM
  3. Drop Down List association
    By Alessio.Balloni in forum Help
    Replies: 1
    Last Post: 2010-01-07, 05:01 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
  •