Results 1 to 2 of 2

Thread: Building a new relationship with emails (e-mails)

  1. #1
    youssefaoun is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    55

    Default Building a new relationship with emails (e-mails)

    Hello,

    I am trying to build a new relationship with the module e-mails.
    The new module is Scontacts

    The relationship file emails_scontactsMetaData.php contains the following:

    PHP Code:
    <?php
    $dictionary
    ['emails_scontacts'] = array (
        
    'table' => 'emails_scontacts',
        
    'fields' => array (
            array(
                
    'name' => 'id',
                
    'type' => 'varchar',
                
    'len'=>'36'
            
    ),
            array(
                
    'name' => 'email_id',
                
    'type' => 'varchar',
                
    'len' => '36',
            ),
            array(
                
    'name' => 'scontact_id',
                
    'type' => 'varchar',
                
    'len' => '36',
            ),
            array (
                
    'name' => 'date_modified',
                
    'type' => 'datetime'
            
    ),
            array(
                
    'name' => 'deleted',
                
    'type' => 'bool',
                
    'len' => '1',
                
    'default' => '0',
                
    'required' => true
            
    )
        ),
        
    'indices' => array (
            array(
                
    'name' => 'emails_scontactspk',
                
    'type' => 'primary',
                
    'fields' => array('id')
            ),
            array(
                
    'name' => 'idx_scon_ema_ema',
                
    'type' => 'index',
                
    'fields' => array('email_id')
            ),
            array(
                
    'name' => 'idx_scon_ema_eco',
                
    'type' => 'index',
                
    'fields' => array('scontact_id')
            ),
            array(
                
    'name' => 'idx_scontact_email',
                
    'type' => 'alternate_key',
                
    'fields' => array('email_id','scontact_id')
            )
        ),
        
    'relationships' => array (
            
    'emails_scontacts' => array(
                
    'lhs_module' => 'Emails',
                
    'lhs_table' => 'emails',
                
    'lhs_key' => 'id',
                
    'rhs_module' => 'Scontacts',
                
    'rhs_table' => 'scontacts',
                
    'rhs_key' => 'id',
                
    'relationship_type' => 'many-to-many',
                
    'join_table' => 'emails_scontacts',
                
    'join_key_lhs' => 'email_id',
                
    'join_key_rhs' => 'scontact_id'
            
    )
        ),
    );

    ?>
    It is a copy of the "Example_module", in other words the Widgets module


    I HAVE ABSOLUTELY NO RESULT. THE SAME THING WORKS WITH Contacts, Cases...etc

    Any hints?

    Regards,
    Youssef AOUN
    Software Eng.

  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: Building a new relationship with emails (e-mails)

    Hi, youssefaoun.

    Did you define the field emails into scontacts vardefs and the fields scontacts into emails vardefs?

    This could be the reason.

    Cheers

    André Lopes
    Lâmpada Global Services
    Av. Angelica, 1814 cj. 1502
    São Paulo, SP 01228-200
    tel1. 55 11 3668-6776
    tel2. 55 11 3822-2581
    cel. 55 11 7636-5859
    messenger: andopes@yahoo.com.br
    skype: andopes
    e-mail: andre@lampadacrm.com.br

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. problemi step 6 di SugarSuite-Full-4.0.1h
    By lucia in forum Italiano
    Replies: 0
    Last Post: 2006-12-27, 08:50 AM
  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. Fatal error: Max
    By spokes2k4 in forum Help
    Replies: 3
    Last Post: 2006-01-15, 03:50 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
  •