Results 1 to 4 of 4

Thread: How do i relate data in a newly developed module

  1. #1
    stephen_ari is offline Member
    Join Date
    Feb 2006
    Posts
    8

    Default How do i relate data in a newly developed module

    I'm using version 5.0d. I created a new module using the module builder and related it to leads and contacts. I can create a new lead and enter data into the new module, but when I convert that lead to a contact the data does not appear in the mopdule for the contact. What am I missing?

    Thank you

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

    Default Re: How do i relate data in a newly developed module

    Have you read this wiki on creating relationships between modules?
    What do you think the cookie monster eats ?

  3. #3
    MDSPaul is offline Junior Member
    Join Date
    May 2008
    Posts
    1

    Default Re: How do i relate data in a newly developed module

    I'm working for stephen_ari on the above problem, but I run into the following problem.

    Whenever I try to repair the database using the above directions, it never seems to finish. It stalls on

    Repair Database

    Processing database and vardef comparison...

    I just can't get past the very first repair for the first file. I go admin - repair. Any idea why?
    The package was named Creditor, the module name CR_Account. When installed, I see a folder credi_CR_Account in the sugar directory. I'm not sure precisely what to put for the module name, since I would have assumed the name in the module builder would have matched the directory name for the module. The field name is test_relate_lead, i tried just that for the key as well as test_relate_lead_c for the rhs_key

    Looking in the module builder, there were some existing relationships. Didn't work. Deleting those relationships and the relationship field and starting over didn't help.

    My most recent attempt of many:
    Code:
    <?php
    $dictionary['Leads']['relationships']['Leads_CR_Account'] = array( 
    'lhs_module' => 'Leads', 
    'lhs_table' => 'Leads', 
    'lhs_key' => 'id', 
    'rhs_module' => 'CR_Account',
    'rhs_table' => 'CR_Account_cstm', // must use custom table as we're using a custom Relate field in step 4
    'rhs_key' => 'test_relate_lead_c', // must match the name of the field containing the PARENT id in the CHILD_cstm table
    'relationship_type' => 'one-to-many' // one LHS to many RHS
    );
    
    $dictionary['Leads']['fields']['lead_relate'] = array ( 
    'name' => '<test_relate_lead>', 
    'type' => 'link', 
    'relationship' => 'Leads_CR_Account', 
    'source'=>'non-db', 
    'vname'=>'lbl_test_relate_lead', 
    );
    *<LBL_FIELD_LABEL> can be anything you want, but it must match the key you use in the language file later on
    ?>

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

    Default Re: How do i relate data in a newly developed module

    Hi,
    I guess you copied the code from the wiki and put it by hand in the php files...
    At a first glance, there is at least one error, that is this line in your code:
    Quote Originally Posted by MDSPaul
    Code:
    *<LBL_FIELD_LABEL> can be anything you want, but it must match the key you use in the language file later on
    Delete it, save and try repairing again.
    What do you think the cookie monster eats ?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. I Can't Get Passed the Logon Page!
    By whatistocome in forum Help
    Replies: 109
    Last Post: 2010-12-28, 07:37 AM
  2. SugarCRM/info@Hand customization
    By rhafemeister in forum Classifieds
    Replies: 6
    Last Post: 2008-05-31, 03:30 AM
  3. importing data to a custom module
    By yucelozcan in forum Help
    Replies: 3
    Last Post: 2007-12-21, 01:44 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
  •