CRM

Mc8
Miembro

Custom objects - fetching recently updated records - deleted items/associations

resolver

As it's not possible to take advantage of the event subscriptions available in Hubspot Apps (Custom objects aren't supported). I've built something to fetch recently modified custom object records using the search API (/crm/v3/objects/p12345_custom/search).

 

I've run into a couple of snags however and any suggestions or workarounds would be appreciated:

 

1. I need to know when a custom object is deleted - it seems that it is not possible to see archived records using the search API.

 

2. Whenever a contact is associated to the custom object the hs_lastmodifieddate field is not updated, therefore it does not appear in my API request for recently modifed records.

 

Additionally is there any timeline for when custom objects will be supported in Hubspot Apps as both cases are handled perfectly by it for Contacts/Companies/Deals?

 

Thanks

0 Me gusta
1 Soluciones aceptada
BHarrison-Cook
Solución
Participante

Custom objects - fetching recently updated records - deleted items/associations

resolver

Hi,

 

Came across this whilst researching another problem, I know it's quite old now, but posting how I solved this in case it helps.

 

For your point 2, i had a similar issue. As a fix, i added properties to each of my objects showing the Count of Associations to each other object. This then forces the last modified date to update, as an actual property is being updated.

 

Example, Contacts and Customer Object 1

 

On Contacts, add a calculated property for the number of associations to Custom Object 1

On Custom Object 1, add a calculated property for the number of associations to Contacts.

 

When added or removing an association to either object, both properties will be updated and the last modified date on each obejct will also be updated. meaning it then appears in any search calls using last modified date.

 

Hope that helps.

Ver la solución en mensaje original publicado

4 Respuestas 4
BHarrison-Cook
Solución
Participante

Custom objects - fetching recently updated records - deleted items/associations

resolver

Hi,

 

Came across this whilst researching another problem, I know it's quite old now, but posting how I solved this in case it helps.

 

For your point 2, i had a similar issue. As a fix, i added properties to each of my objects showing the Count of Associations to each other object. This then forces the last modified date to update, as an actual property is being updated.

 

Example, Contacts and Customer Object 1

 

On Contacts, add a calculated property for the number of associations to Custom Object 1

On Custom Object 1, add a calculated property for the number of associations to Contacts.

 

When added or removing an association to either object, both properties will be updated and the last modified date on each obejct will also be updated. meaning it then appears in any search calls using last modified date.

 

Hope that helps.

kvlschaefer
Administrador de la comunidad
Administrador de la comunidad

Custom objects - fetching recently updated records - deleted items/associations

resolver

Hi @BHarrison-Cook,

 

Thanks for sharing this solution! 

 

Best,

Kristen


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Me gusta
Mc8
Miembro

Custom objects - fetching recently updated records - deleted items/associations

resolver

Hello webdew

 

Thanks for the response. So for point 1 it's just not possible to get any indication or event through when a custom object is deleted?

 

For point 2 to clarify I just need to see the modified date change on the custom object when a contact is associated to the custom object. You suggested it does this however my tests indicate it does not. I used the API call https://api.hubapi.com/crm/v3/objects/custom-id/103425418?hapikey=123 to check. Associating records did not change the hs_lastmodifieddate field - it only changed when updating a field on the custom object record itself.

 

 

 

Screenshot 2021-04-14 at 15.04.29.png

0 Me gusta
webdew
Guía | Partner nivel Diamond
Guía | Partner nivel Diamond

Custom objects - fetching recently updated records - deleted items/associations

resolver

Hi @Mc8 ,

For the first point: 1 if the custom object has been deleted...you cannot see that.

Second, if you do any updation in custom object then it will not update hs_lastmodifieddate field in contacts...but only in custom object.

Hope this helps!