Jun 26, 2021 1:55 AM
I'm executing a script that takes a list of custom object-to-contact id pairs where each pair of ids needs to be associated to each other.
For each id pair, I'm using the association end point on the object to create the association.
For each pair, I receive back a 200 response indicating that the association has been made successfully, however, in cases where a contact id appears more than once in the list, it is only actually saving one occurrence of the contact id to its respective custom object - all other occurrences of this contact id associating to other custom objects will not save - THIS IS DESPITE RECEIVING BACK A 200 ON THESE OTHER OCCURRENCES.
Does this have something to do with API calls being made too frequently on a single contact ID? I have a 1 second delay between each API call - should this be extended?
Solved! Go to Solution.
Jun 26, 2021 3:00 AM
I have identified the issue that the association cardinality/inverseCardinality between these two objects is ONE_TO_MANY/ONE_TO_ONE and in fact needs to be ONE_TO_MANY in both directions.
Since I already have this association in place with objects associated, is there a way to update the association cardinality types directly?
Ideally, there is a method to update without needing to remove the objects already associated, re-create the association, and then re-associate all of the objects.
Jun 28, 2021 5:06 AM
thank you for sharing! 🙂
Jun 29, 2021 12:30 AM
The 200 success responses on the updates is what threw me off because it appeared that all of the associations were saving correctly but it wasn't clear that on each 200 success being returned, the back-end was implicitly removing the association for that contact from the other object it was already associated with. It would be a nice feature if the response could provide some indication that an association was removed while making the new association due to the cardinality restriction.