CMS Development

Manobyte
投稿者 | Diamond Partner
投稿者 | Diamond Partner

Display associated custom object records

解決

I created the custom object "Jobs", I then created an association for Jobs to contacts. I would like to pull all associated jobs for the individual contact, only I seem to be running into an issue.

 

I have reviewed the documentation here for CRM associations , and I can make it pull a list of contacts associated with a job using {{ crm_associations(jobID, "USER_DEFINED", 17) }} but when I try to switch it to list jobs, nothing is returned. Is the "association type id" different if you invert them?

0 いいね!
1件の承認済みベストアンサー
Brownstephen101
解決策
トップ投稿者 | Elite Partner
トップ投稿者 | Elite Partner

Display associated custom object records

解決

Yes, the ID is different when you invert them, when you created your object it should have returned it's associations and their different ids. In the json, there should be a "From" and "To" key for each pairing. You have to make sure the ID you are using from the proper direction.

Example:

{
"fromObjectTypeId": "2-3444025",
"toObjectTypeId": "2-555555",
"name": "cat_to_dog"
}



If you dont have the json, you can run a "Read" request on your object to get the json again. Or, In my experience, the id will normally be 1 off of your current use case (so likely 16 or 18), so you could try to just update it that way and see if that works, but this isn't always the case.

https://developers.hubspot.com/docs/api/crm/crm-custom-objects

元の投稿で解決策を見る

1件の返信
Brownstephen101
解決策
トップ投稿者 | Elite Partner
トップ投稿者 | Elite Partner

Display associated custom object records

解決

Yes, the ID is different when you invert them, when you created your object it should have returned it's associations and their different ids. In the json, there should be a "From" and "To" key for each pairing. You have to make sure the ID you are using from the proper direction.

Example:

{
"fromObjectTypeId": "2-3444025",
"toObjectTypeId": "2-555555",
"name": "cat_to_dog"
}



If you dont have the json, you can run a "Read" request on your object to get the json again. Or, In my experience, the id will normally be 1 off of your current use case (so likely 16 or 18), so you could try to just update it that way and see if that works, but this isn't always the case.

https://developers.hubspot.com/docs/api/crm/crm-custom-objects