Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Custom fields can be known by various names in different applications - here are just a few that I am aware of.

...

Code Block
create or replaceview `v_custom_fields` as
select
    `a`.`name` as `Custom_Field_Name`,
    `a`.`attribute_type` as `Custom_field_Type`,
    `a`.`entity` as `Custom_Field_Table`,
    `v`.`Attribute_id` as `Custom_field_Link`,
    `v`.`value` as `Custom_field_value`,
    `a`.`tennant_id` as `tennant_id`
from
    (`additional_attributes` `a`
join `additional_attributes_values` `v` on(`a`.`id` = `v`.`table_row_id`));
Info

If this does not make sense - we’ll happily help you, or I’m sure you favourite AI LLM (ChatGPT) would get you your logic pretty quickly.

😍 Now I we have what I we need.

Adding a Custom Table to pi

...

If we remember the objects we specified.

Info

Essential

  • The name of the attribute (Dependants, Birthday, Probation, Colour……)

  • What the value is (2,16/08/1973,No,Pink……….)

  • The foreign key that links it back to the core (USERS,PRODUCTS,JOBS) tables. image-20240823-141848.png

Good To Have

  • The table it links to ie, USERS, PRODUCTS or JOBS

  • The Column Type i.e. Date, String (text) or Number. …. Anything you can deal with types

  • A Customer / Organisation / Tenant ID - (You can use user restrictions - but this will help performance

...

[[User Fields+cf=Probation]]{{Yes}}. We use the same syntax in the URL as we do in {{object}} replacements using +cf to indicate this is a customer field.

So…

[[Object Name+cf=Custom Field Name]]{{Value}}

...

Custom Fields In A User Restriction

...

You may also find an advantage in partitioning your tables / data around your Tennant ID limitation.

Info

You will need to experiment on your database - and tweak for perfromance. It could be the case that using composite indexes including multiple columns could provide the most optimal queries for you.

Number of objects

As every object creates an additional inline SELECT statement, if a query where to contain as large volume of these selects then this could also have a impact on query perfromance. At very high volume you may still need to consider instantiating the data into a normalised Data Warehouse structure.

...