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 use to create relationships, according to most sugar lessons. The code works when I use 2 base modules (e.g. Leads / Contacts), but it fails when I try to use it with custom modules.
In this case, the geral_pessoa_juridica module is normal, geral is the package name and pessoa_juridica. I am sure that the name is correct, it works for other functions.
This function returns me this
5ec9ca75-e09d-e2d8-0c2b-4df7ac377dcf creating relationship array(3) { ["created"]=> int(0) ["failed"]=> int(1) ["deleted"]=> int(0) }
I am not sure WHY this fails - when studying sugarcrm.log, I see that he did not even try to create a relationship.
I redo the module twice, try to create the tables manually, following the Sugar standard, which I saw in other respects, reset MySQL privileges, made all possible repairs in Sugar. I can not reinstall it because it is in production.
Any ideas on how to fix it?