APIs & Integrations

ian12sm
Member

Updating enumeration properties with read_only_value

I’m working on a plugin to populate hubspot fields with woocommerce purchases.

I was wondering how I can go about adding options to enumeration properties when those enumeration fields have the read_only_value set on them? My requests I’m sending through the api return the following snippet from json.

“message”:"Field ‘read_only_value’ cannot be modified for property ‘categories_bought’

This is happening for several enumeration fields. How do I go about either removing read only from these fields, or bypassing this through the API?

I’ve tried searching through documentation for this and have come across very little, thanks in advance!

5 Replies 5
athena
Member

Updating enumeration properties with read_only_value

Hi,

I got the same problem.

My property:
“readOnlyValue”: false,
“readOnlyDefinition”: false,

However, when I tried to update its type from date to datetime, it would return:
{
“status”: “error”,
“message”: “Field ‘read_only_value’ cannot be modified for property ‘newcustomproperty’.”,
“correlationId”: “adfac5c9-ccdd-4490-98fa-5143a6dc3d6d”,
“requestId”: “3a82027a314f7252ca5919ab1e3f0a88”
}

Any idea?

0 Upvotes
Not applicable

Updating enumeration properties with read_only_value

Hi Supporters,

Any ideas?

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Updating enumeration properties with read_only_value

If a property has the readOnlyValue flag set to true, the property can’t be updated manually, only a HubSpot internal process would be able to update the value.

If the property has readOnlyDefinition set to false, you could update the property settings and set that readOnlyValue flag to false as well, which would allow the property to be updated normally. Otherwise, if these are custom properties that are getting created with readOnlyValue and readOnlyDefinition both set to true, you’d need to contact support to have those properties updated. Normally those flags are only set for HubSpot system properties, so if you’re creating custom properties through the API, you’d want to make sure both of those flags are being set to false when the properties are created.

0 Upvotes
athena
Member

Updating enumeration properties with read_only_value

Also, to follow up, which one should I change to “datetime”? Type or Field Type?

“type”: “date”,
“fieldType”: “date”,

0 Upvotes
Not applicable

Updating enumeration properties with read_only_value

Hi,

For now, I got same issue https://www.screencast.com/t/Rpj0udKmEy7 . But my custom field is not readonly type https://www.screencast.com/t/EOjMG4uSer .

What is my wrong? @dadams any ideas?

0 Upvotes