I need to set a 1-to-many relationship between a Document that I upload via the SOAP API and a custom module called ass_Assignments. I’m not quite sure what is supposed to go in the “link_field_name” or the “name_value_list” fields in the set_relation() call. I’ve looked at other examples such as Contacts and Opportunities in the docs, but those relationships don’t exist in the system I’m working on, so I can’t compare and contrast.
When I set a relation via the GUI, the table ass_assignments_documents_1_c gets updated, specifically the two fields ass_assignments_documents_1ass_assignments_ida (which holds the assignment ID) and ass_assignments_documents_1documents_idb (which holds the document id).
The tables are both have an “assignment_no” that exists in both tables.
The call I’m making now is this:
$result = $this->soapclient->set_relationships( $this->sess_id, "ass_Asignments", $assignId, "assignment_no", array($docId), array( ), # what goes here? 0 );
When I run this, I get an “Invalid data sent” error.
What I don’t understand is what to put into the “link_field_name” and what goes in the “name_value_list”? Also, how does the system know I’m linking to a Document and not, say, an Opportunity.