According to the docs I’ve come across, to set a relationship, I need the module id of one (or both, depending on version) of the modules. Where do I find the module id?
N.B. I’m not asking about the id for a record in the module, I want it for the module itself (“Documents”, “Accounts”, etc.).
I’m doing this via the SOAP interface, if that’s of any concern.
Been there, read that. I don’t see where the id for the Accounts MODULE is being retrieved. I do see where the id of Accounts RECORDS are being retrieved.
Look at line 9 of the PHP example of set_relationship found here. That is the information I’m looking for. Not the module name. Not the module label. The module ID.
Your are confused, there is no module id! That link you are referring to is for use with the web services API. Are you using SOAP or REST to interact with Suite? If not and you are just trying to write code within Suite then the link I gave you is all you need.
Even in the code in the link you posted the ‘module_id’ parameter is referring to a record id.
It even tells you in the paramaters table in your ink: module_id String The ID of the specified module record. :whistle:
Its quite simple:
‘module_name’ => ‘Opportunities’, tells it which module to use.
‘module_id’ => ‘15e79b92-5025-827f-0784-50aa578270d8’, tells it which record within Opportunities to use
‘link_field_name’ => ‘contacts’, tells it which relationship to use
‘related_ids’ => array( ‘19b8799e-64ae-9502-588c-50aa575454c9’, tells it which contact records to relate to the Opportunities record
),
But once again this is only used in a SOAP or REST call!