Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6903107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:53:03+00:00 2026-05-27T07:53:03+00:00

function createPJOpportunityRelationship($pj_id, $op_id) { echo creating relationship; $set_relationship_value = array( ‘module1’ => ‘geral_pessoa_juridica’, ‘module1_id’

  • 0
function createPJOpportunityRelationship($pj_id, $op_id) {
    echo "creating relationship";

    $set_relationship_value = array(
        'module1' => 'geral_pessoa_juridica', 'module1_id' => $pj_id,
        'module2' => 'Opportunities', 'module2_id' => $op_id
    );

    $set_relationship_params = array(
        'session' => $this->ses,
        'set_relationship_value' => $set_relationship_value
    );

    $set_relationship_result = $this->soap->call('set_relationship', array(
        'session' => $this->ses,
        'set_relationship_value' => $set_relationship_value));

    var_dump($set_relationship_result);
}

This is the code I’m using to create a relationship, according to most sugar tutorials. The code works when I’m using 2 basic modules (Like Leads/Contacts) but it fails when I try it with custom built modules.

In this case, the geral_pessoa_juridica module is a custom one, geral being the package and pessoa_juridica the name. I’m sure the name is correct, it works for other functions.

This function returns to me this

5ec9ca75-e09d-e2d8-0c2b-4df7ac377dcf
creating relationship
array(3) {
["created"]=> int(0)
["failed"]=> int(1)
["deleted"]=> int(0)
}

I’m not sure WHY it fails – studying sugarcrm.log, I see it didn’t even tried to create the relationship.

I remade the module twice, tried to create the tables manually following the Sugar standard I saw in other relationships, flushed MySQL privileges, did all the repairs possible in Sugar. I can’t reinstall it because it’s on production.

Any ideas on how to fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:53:04+00:00Added an answer on May 27, 2026 at 7:53 am

    Solved, or kinda of.

        $set_relationship_params = array(
            'session' => $this->ses,
            'module_name' => 'custom_module', /* custom module, where the relationship was created, "primary module" */
            'module_id' => $custom_id, /* id of site, get from set_entry call */
            'link_field_name' => 'module', /* the LINK field type name, from Step 5  */
            'related_ids' => array($module_id) /* id of Account you want to relate to */
        );
    
        print_r($result = $this->soap->call('set_relationship',$set_relationship_params)); //nuSoap
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function returnsAnArray () { return array ('test'); } echo returnsAnArray ()[0]; generates a syntax
function register_contact ($person = array()) { $nogood = false; foreach ($person as $val) {
function build_list($id=0,$collapsed=) //return an array with the categories ordered by position { $RootPos =
function msg ($msg) { echo <script type='text/javascript'>alert('$msg');</script>; } if (count($_POST)) { msg('TEST!!!!!'); } <!DOCTYPE
function heaviside(&$value, $key, &$array) { if($key > 0) $value = $array[$key-1].$array[$key]; } function test_heaviside()
function a($function, $array) { global $test $test->$function(implode(',' $array)); } For example, I want to
Function.prototype.bind = function(){ var fn = this, args = Array.prototype.slice.call(arguments), object = args.shift(); return
Function FillAdminAccount() As Boolean FillAdminAccount = True Try SQLconn.ConnectionString = connect timeout=9999999; & _
function Submit_click() { if (!bValidateFields()) return; } function bValidateFields() { /// <summary>Validation rules</summary> ///
function main() { Hello(); } function Hello() { // How do you find out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.