Results 1 to 6 of 6

Thread: SOAP Relationship Problem

  1. #1
    comdivisionys is offline Member
    Join Date
    Oct 2009
    Posts
    6

    Default SOAP Relationship Problem

    I try for several hours to get the soap relationship working. The SOAP session must be correct, as I can successfully create the Account and contact.

    I checked the ID and also tried it with Accounts and Contacts switched around. I also tried it with the set_relationship_value array in it and without. So basicly all examples I could finde...

    Any idea?

    PHP Code:
            $set_relationship_params = array( 
                
    'session' => $session,
                
    'set_relationship_value'=>array(
                
    'module_name' => 'Accounts',
                
    'module_id' => $sugarID
                
    'link_field_name' => 'Contacts',
                
    'related_ids' => $sugarContactID,
                )
            );
            
            
    $result $client->call('set_relationship',$set_relationship_params); 

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,811

    Default Re: SOAP Relationship Problem

    Try

    Code:
    module1 => 'Accounts',
    module1_id => $sugarID,
    module2 => 'Contacts',
    module2_id => $sugarcontactID
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    comdivisionys is offline Member
    Join Date
    Oct 2009
    Posts
    6

    Default Re: SOAP Relationship Problem

    Hi Angel,

    I tried all variants, with session, without... Put your code in ' and as you wrote without, but no sccess.

    Is that maybe that with 6.x the Accounts Contacts relationship is special?

    Any idea would be helpful, as this is key for the implementation...

    Thanks

    Yves

  4. #4
    comdivisionys is offline Member
    Join Date
    Oct 2009
    Posts
    6

    Default Re: SOAP Relationship Problem

    Gotcha, I got it...

    for everyone trying to build the same, the following code works as of 6.1

    PHP Code:
            //CREATE RELATIONSHIP BETWEEN NEW CONTACT AND ITS ACCOUNT
            
    $set_relationship_params = array( 
                
    'session' => $session,
                
    'module_name' => 'Accounts',
                
    'module_id' => $sugarID
                
    'link_field_name' => 'contacts',
                
    'related_ids' => array($sugarContactID)
            );
            
            
    $result $client->call('set_relationship',$set_relationship_params); 
    Thanks again for all help!

  5. #5
    jdbertron is offline Sugar Community Member
    Join Date
    May 2011
    Posts
    12

    Default Re: SOAP Relationship Problem

    I have a similar problem, setting up a relationship using the Java wsdl generated api.

    I use the SOAP set_entry to create two record in two of my modules, which have a 1-n relationship. The call is successful and creates the record in the database.
    I use set_relationship to create the relationship between the two records and the call succeeds and creates a record in the correlation database table.
    Yet, Sugar doesn't see the association and a query to the parent record asking for linkfields doesn't return any relations.

    If however I create the record in Sugar, the query using the link field has no problem finding the association.
    This is puzzling since I can see the proper ida/idb record in the correlated tables in MySQL.
    I've tried repair as well.

    Does anyone have any suggestion ?

    Thanks.
    J.D.


    Code:
    New_set_entry_result result = client.set_entry(sessionId, Constants.ticketsModule, nvl);
    	String[] ids = new String[1];
    	ids[0] = result.getId();			
    	client.set_relationship(sessionId, Constants.satelliteModule, gt_satellite_id, "is3_ticket_is3_satellite", ids, null, 0);
    Last edited by jdbertron; 2011-07-08 at 03:54 PM. Reason: code exerpt

  6. #6
    textlocal is offline Sugar Community Member
    Join Date
    Nov 2011
    Posts
    16

    Question Re: SOAP Relationship Problem

    Did anyone ever solve this? Got another thread which raises the same problem...

    Thanks
    James

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Removing a relationship using SOAP
    By shipleyr in forum Developer Help
    Replies: 15
    Last Post: 2010-07-27, 03:19 AM
  2. How to remove relationship through soap
    By Mubi in forum Developer Help
    Replies: 4
    Last Post: 2010-06-25, 10:14 AM
  3. Soap Relationship Problem
    By averillis in forum Developer Help
    Replies: 1
    Last Post: 2010-01-07, 01:20 PM
  4. Deleting a relationship through SOAP
    By snapkurt in forum Developer Help
    Replies: 1
    Last Post: 2009-02-25, 10:04 PM
  5. SOAP Set Relationship - how to delete a relationship?
    By darcy.rippon in forum Developer Help
    Replies: 0
    Last Post: 2009-02-02, 07:22 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
  •