Results 1 to 2 of 2

Thread: SOAP Import, set_relationship, many-to-many

  1. #1
    ymfc is offline Junior Member
    Join Date
    May 2011
    Posts
    6

    Default SOAP Import, set_relationship, many-to-many

    Good day to you, ladies and gentlemen,

    I have a problem when trying to set relationships between two custom modules in SugarCRM Version 6.2.0RC1 (Build 6311)

    Here is what my code looks like:

    PHP Code:
    protected function SOAPset_relationship($moduleName$moduleEntryID$linkFieldName$IDArray) {
            
    $res $this->SOAPclient->set_relationship(
                
    $this->sugarSession,
                    
    $moduleName,
                    
    $moduleEntryID,
                    
    $linkFieldName,
                    
    $IDArray
            
    );
            if (
    $res->created != 1) {
                echo 
    "SOAPset_relationship failed for: \n",
                    
    $moduleName"\n",
                    
    $moduleEntryID"\n",
                    
    $linkFieldName"\n",
                    
    print_r($IDArraytrue), "\n",
                    
    print_r($restrue), "\n";
            }
            return 
    $res;
        } 
    This works fine with one-to-many and one-to-one relationships, but I can not get it to work with many-to-many.

    The relationships table has the following entries for my relationship:
    Code:
    id, relationship_name, lhs_module, lhs_table, lhs_key, rhs_module, rhs_table, rhs_key, join_table, join_key_lhs, join_key_rhs, relationship_type, relationship_role_column, relationship_role_column_value, reverse, deleted
    
    'SOMELONGID', 'key_apples_key_worms', 'key_apples', 'key_apples', 'id', 'key_worms', 'key_worms', 'id', 'key_apples_key_worms_c', 'key_someweirdname1111111_ida', 'key_someweirdname222222_idb', 'many-to-many', '', '', 0, 0
    I have tried to call my function with all the possible combinations:

    PHP Code:
    $this->SOAPset_relationship('key_apples'$applesID'key_someweirdname1111111_ida', array($wormsID));
    $this->SOAPset_relationship('key_apples'$applesID'key_someweirdname222222_idb', array($wormsID));
    $this->SOAPset_relationship('key_worms'$wormsID'key_someweirdname1111111_ida', array($applesID));
    $this->SOAPset_relationship('key_worms'$wormsID'key_someweirdname222222_ida', array($applesID)); 
    but it always returns :

    Code:
    stdClass Object
    (
        [created] => 0
        [failed] => 1
        [deleted] => 0
    )
    I do not have much experience with SugarCRM, I would appreciate any help.
    Last edited by ymfc; 2011-09-12 at 02:45 PM.

  2. #2
    ymfc is offline Junior Member
    Join Date
    May 2011
    Posts
    6

    Default Re: SOAP Import, set_relationship, many-to-many

    Bummmmmmp :>

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. set_relationship with SOAP v2
    By Steverino541 in forum Developer Help
    Replies: 2
    Last Post: 2011-09-14, 01:22 AM
  2. Soap set_relationship and many-to-many
    By lightningspirit in forum Developer Help
    Replies: 2
    Last Post: 2010-11-16, 11:20 AM
  3. need SOAP set_relationship help
    By darcy.rippon in forum Developer Help
    Replies: 5
    Last Post: 2009-02-02, 07:24 PM
  4. set_relationship via SOAP in 5.1
    By josh.sweeney in forum Developer Help
    Replies: 1
    Last Post: 2008-09-27, 12:20 AM
  5. SOAP set_relationship()
    By George in forum Developer Help
    Replies: 0
    Last Post: 2006-01-11, 10:51 PM

Tags for this Thread

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
  •