Custom object displayOrder is unique?

Hi.

Recently, my company started getting errors. Specifically, since 9th of August, we’ve started getting the errors on our test environment, while on our production we’ve started getting these errors since 21st. These two dates do not relate to one another in our platform.

However, since these, we’ve randomly started getting errors when we are updating custom objects. Below are the request headers and the request itself:

The request body is as follows:

const requestBody = {
 options: [
 {
 label: "label1",
 value: "id1",
 description: "description1",
 displayOrder: 1,
 hidden: false,
 },
 {
 label: "label2",
 value: "id2",
 description: "description2",
 displayOrder: 1,
 hidden: false,
 },
 {
 label: "label3",
 value: "id3",
 description: "description3",
 displayOrder: 1,
 hidden: false,
 },
 ],
};

Now, the error I’m getting from the response is following:

const err = {
 status: "error",
 message:
 "Property option display orders must be unique. For the property display orders of object type '0-1' in portal 25032844 these options are duplicated: <list of duplicates>",
 category: "VALIDATION_ERROR",
 subCategory: "PropertyValidationError.DUPLICATE_OPTION_DISPLAY_ORDER",
};

Now, I understand WHY it throws the error - the display orders must be unique. However, it started out of nowhere on a code that’s 4 months old.

Can anyone navigate me/point me in the direction as to what has changed? I’ve gone through the changelog and found no such thing and searching for the property validation error was unsuccessful - I found exactly 0 references to it on google.

Hello @SProchazka

The error you’re encountering might be a result of a recent update in HubSpot. Upon reviewing the HubSpot changelog, it seems that an update was implemented on August 9th. This update introduced a new feature related to custom objects, specifically a validation rule that enforces uniqueness in the display order of custom object options.

In simpler terms, it means that the change causing the error likely occurred on August 9th. However, the error might not have become apparent until a later time, depending on when you last updated your code.

To address this error, you’ll need to ensure that the display order of all options in your request body is unique. This can be achieved by either manually adjusting the display order of the options or by using a tool like HubSpot’s Custom Object Editor. This should help resolve the issue you’re facing.

Hi @himanshurauthan ,

thank you for your response. The error has already been fixed on our side. There’s one last question from my side.

You’ve mentioned changelog. Any idea where I would find it? I’ve gone through the changelog here and didn’t manage to find it. HubSpot Developer Changelog

Marking the solution as accepted as it indeed is the correct solution.