Relationfields on extratable not returned unless Custom Objects toggle is on?

lock
push_pin
done
Besvarat
4

Hi,

I'm troubleshooting an issue at a customer which does not have the Custom Objects features toggled on yet. The application was developed in SOD with Custom Objects enabled, and other customers in prod running it have Custom Object toggled on.

Via HTTP I'm calling the following REST API method:

POST {{baseurl}}v1/archive/CustomObject:y_my_custom_table
Authorization: Bearer {{token}}
Accept: application/json
 
This returns something like this:

{
"odata.metadata": "https://app.superoffice.com/Cust00000/api/v1/Archive/$metadata",
"odata.nextLink": null,
"value": [
{
"PrimaryKey": "1",
"EntityName": "y_my_custom_table",
"id": 1,
"x_contact_id": "External Consultants",
"x_startdato": "2026-11-24T00:00:00",
"x_varsling_dager": 60,
"x_textfield": "Testing",
"x_ansvarlig_associate_id": 280,
"x_dokument_id": 0,
"x_andre_detaljer": "",
"x_project_id": "",
"x_sale_id": "",
"x_person_id": ""
}
]
}

There are two issues here;
1) All fields who are a relation to another extratable is missing completely. There should have been x_status_id and a x_type_id fields in the result as well.
2) The x_contact_id field returns the name of the company, not the ID. During development in SOD (where Custom Objects is toggled on) I got the contact_id as a number.
 
Is this becase Custom Objects isn't toggled on in the tenant?

26. nov. 2026 | 09:26 fm

Allt Svar (4)

Hi Frode,

 

Yes the CustomObjects Feature toggle influence what columns are returned and in what format. Are you sure the table setup is the same between SOD and Development? (checkboxes like 'Show fields in target table in archives:' also influence the API response)

26. nov. 2026 | 09:35 fm

Hi David, thanks for the quick reply!

This is the second time we've encountered the problem (for two different solutions at two different customers). In both cases the Test env had CustomObjects, but Prod did not.

Then I think we can blame Custom Objects toggle for this. I'll see if we can get it toggled on to see if that solves it.

26. nov. 2026 | 09:39 fm

Hi Frode,

Yes, the Custom Objects toggle explains what you’re seeing. The toggle doesn’t hide data. It changes the names and shapes of the archive columns for relation fields. Your request has no $select, so the endpoint chooses the columns, and the two tenants end up returning different ones.

How the default column set is chosen

Without $select, the archive REST endpoint returns all available top-level columns of the provider, meaning every column whose name doesn’t contain a /. Columns that belong to a related table are prefixed with a path (for example y_status/x_name), so they are never in the default output.

Without Custom Objects (your Prod tenant)

  • Relations to people, companies, projects and sales are lookup columns. Their value is the name or heading of the related record, not its id. That’s why you get “External Consultants”.
  • Relations to another extra table never get a column of their own. They are joined in as columns, e.g. y_status/x_name. Those columns contain a /, so they’re left out of the default output. The “Show fields in target table in archives” setting only decides how many of those columns exist. They’re left out either way.

With Custom Objects (SOD)

  • Every relation field gets an integer column named , which holds the related record’s id. These names have no /, so they are included in the default output.
  • Company, person, project and sale relations become a sub-tree (). The plain lookup column with the name no longer exists.
  • Extra-table relations set up as a dropdown also keep a top-level column with the display value. Other extra-table relations only get the _id column.

Here’s an example from one of our test tables, with a company relation x_contact and an extra-table relation x_equipment:

  Without Custom Objects With Custom Objects
Company relation x_contact: “Svallen Camping” x_contact_id: 40
Extra-table relation (not returned) x_equipment: “Screwdriver”, x_equipment_id: 1

 

One thing to check: you said x_contact_id came back as a number in SOD. That matches a SOD field named x_contact. Your Prod response shows a field named x_contact_id, which would give x_contact_id_id with the toggle on. The two table definitions are probably not identical. To compare, call GetAvailableColumns on the archive agent for CustomObject:y_my_custom_table in both tenants.

Recommendation

Turning the toggle on in Prod will make it behave like SOD. I’d still avoid depending on archive column names for relation fields, because those names change with the toggle. Two options give the same result whether the toggle is on or off:

  1. Read single rows from the Custom Object endpoint:

    GET /api/v1/CustomObject/y_my_custom_table/{id}
    

    Relation fields come back as ids in encoded form, with the display text alongside:

    "x_contact": "[I:40]",
    "x_contact:DisplayText": "Svallen Camping, SAvdeling",
    "x_equipment": "[I:1]",
    "x_equipment:DisplayText": "Screwdriver"
    

    It reads one row per call, so for lists you can use the archive with $select=id and your filters to find the rows, then fetch each one here.

  2. Bulk reads through the archive, using the row link hint:

    When you include linkhint in $select, each row gets a LinkHint property containing the ids of the relation fields on the table, e.g. ...&x_contact=40&x_equipment=1&.... Relations with no value are returned as 0.

    GET /api/v1/archive/CustomObject:y_my_custom_table?$select=id,x_startdato,x_textfield,linkhint
    

    Each row’s LinkHint contains the ids of all relation fields on the table, e.g. nav=customobject&tableName=y_my_custom_table&id=1&x_contact_id=123&x_status_id=4&x_type_id=7&PkName=id. You have to parse it, but it’s the same with or without the toggle.

I’d avoid explicitly selecting y_status/... columns, or per-column hints like x_contact_id:linkhint, as a fix. Both work without the toggle today but will stop working once Custom Objects is enabled in Prod.

Best regards

21 h, 56 m sedan | 12:13 em

Thanks Tony, that is very helpful! Appreciate it!

Yes, you are right about the company field. It is called x_contact_id in the database, and appears as x_contact_id_id in the archive when Custom Object is enabled.

21 h, 41 m sedan | 12:28 em

Lägg till svar