CRM

DGirma
Participant

Adding Unique Identifier to an existing Custom Object

SOLVE

I have a custom object I created and I need to add a unique identifier to it, do I have to delete the object and create a brand new one or can I edit the existing custom object to add the unique Identifier?

0 Upvotes
1 Accepted solution
MAC-MCB
Solution
Contributor | Platinum Partner
Contributor | Platinum Partner

Adding Unique Identifier to an existing Custom Object

SOLVE

Hi @DGirma,

It depends a lot on what your use case is for your new custom object.

If it's because you want to change primaryDisplayProperty and you do not have any real data on your custom object yet - I would advise you to create a new one and set "hasUniqueValue": true

If instead it is because you want one of your properties to be unique, so no new object can be created if e.g. VIN already exists - I would advise you to update your custom object with PATCH/crm/v3/schemas/{objectType}
 https://developers.hubspot.com/docs/api/crm/crm-custom-objects

HubSpot Custom Object.png


Best Regards
MARTIN MENSBO CHRISTIANSEN
 

MACMCB_0-1644791143467.png
www.mcb.dk

Best Regards

Martin Christiansen

 

www.mcb.dk

Tlf.: 7012 4816 . Mobil: +45 93 63 04 95

View solution in original post

4 Replies 4
AmandaAdams
Participant

Adding Unique Identifier to an existing Custom Object

SOLVE

does anyone know if it's posisble to do the reverse? DISABLE the unique identifier on an existing custom object?

0 Upvotes
DGirma
Participant

Adding Unique Identifier to an existing Custom Object

SOLVE

Awesome, yes use case is exactly as you described with the VIN. didn't realize I could use the PATCH command to make object have unique value. Thank for your help

0 Upvotes
MAC-MCB
Solution
Contributor | Platinum Partner
Contributor | Platinum Partner

Adding Unique Identifier to an existing Custom Object

SOLVE

Hi @DGirma,

It depends a lot on what your use case is for your new custom object.

If it's because you want to change primaryDisplayProperty and you do not have any real data on your custom object yet - I would advise you to create a new one and set "hasUniqueValue": true

If instead it is because you want one of your properties to be unique, so no new object can be created if e.g. VIN already exists - I would advise you to update your custom object with PATCH/crm/v3/schemas/{objectType}
 https://developers.hubspot.com/docs/api/crm/crm-custom-objects

HubSpot Custom Object.png


Best Regards
MARTIN MENSBO CHRISTIANSEN
 

MACMCB_0-1644791143467.png
www.mcb.dk

Best Regards

Martin Christiansen

 

www.mcb.dk

Tlf.: 7012 4816 . Mobil: +45 93 63 04 95

CloudMaitre1
Participant | Platinum Partner
Participant | Platinum Partner

Adding Unique Identifier to an existing Custom Object

SOLVE

Hello, 
I tried to update the CO using the PATCH per your suggestion and cannot get it to update the UV to true
Hubspot support is advising that it is not possible to change the UniqueValue from false to true

@DGirma did you get this working using @MAC-MCB solution?

0 Upvotes