Database structure plugin question

I’m trying the following:

For each field I check if it a recordtype or a simple field:

If the field is a recordtype, I want to add a certain record called SearchField (a new entity i created in this component). I then set the following:

What I’m trying to achieve here is: if say a field is contact.primary_address (which is a recordtype), I then want to create a searchfield record and set the datatype (which is the plugin field DS_DataTypeSelector) to addresses…

The process then get’s an error saying the following:

[Field data_type does not accept type novulodatastructuretypes]

Is it possible to find out what the db record type is and set it?

What is the type of your data_type field?
I would think you could take a look at the Novulo Filter or Novulo Export components and see how it was set up there? They also have data_type fields.

1 Like

I’ve managed to achieve this with the following method:

I first iterate over all fields of a certain datatype (which is a datatype selector field):

I then cache the field name:

I check if the field is not a foreign key (so is it a database type?):

image

If it is a foreign key (so false), I check if it’s not a function:

image

If it’s not a function, so in this case its a recordtype, I set the datatype selector field with the following value: