CMS Development

Manobyte
Colaborador(a) | Parceiro Diamante
Colaborador(a) | Parceiro Diamante

Display associated custom object records

resolver

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 Avaliação positiva
1 Solução aceita
Brownstephen101
Solução
Top colaborador(a) | Parceiro Elite
Top colaborador(a) | Parceiro Elite

Display associated custom object records

resolver

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

Exibir solução no post original

1 Resposta 1
Brownstephen101
Solução
Top colaborador(a) | Parceiro Elite
Top colaborador(a) | Parceiro Elite

Display associated custom object records

resolver

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