Hi,
I am trying to figure out a way to represent things in Corteza in my own namespace. For the sake of discussion, consider the following context:
Module A:
Field_F1
Field_F2
Field_A1
Field_A2
Module B:
Field_F1
Field_F2
Field_B1
Field_B2
There are two modules, A
and B
which have (from business point of view) two common fields F1
and F2
, and two particular fields: A1
and A2
respectively B1
and B2
.
What I would like is to allow users to see in a list all entries (instances) from either A
or B
with their common fields displayed and searchable in a record list.
I can see two options and I have some problems with both. There may be more and I would be happy to get any hints on different approaches.
Option 1: merge module A
and B
in a single module M
, maybe add a type.
this way, in a record list, one can show both types of entries, with common fields or all fields.
The advantage:
-
M
record list can be used to search, filter either (logical) record kinds.
The disadvantage:
- in the record page for the
M
module I will see bothA#
andB#
fields and when these are quite a few, this implies complexity and some confusion for the end user. What would help here would be a possibility to hide a field based on an expression or function.
Option 2: create a module Combined
which contains only F#
fields. To that, add:
- record reference fields for module
A
andB
- a type to discriminate
- add a workflow to
afterCreate
for eitherA
andB
to generate a syntheticCombined
record with proper values - add workflow to
afterDelete
,afterUpdate
for eitherA
andB
to manage the correspondingCombined
record - limit editing, adding, deleting of
Combined
The advantage:
- record list for
Combined
can be used to display, filter, search, based onF#
fields entries for bothA
orB
. - record page for
A
andB
only show direct info related to them, no confusion here.
The disadvantage:
- apparently there is no way to make a computed field which is a reference to either
A
orB
to display in the record list or record page ofCombined
to allow the user to follow a link to the more detailed page. A workaround here is to display all possible related record reference fields from which only one would have a value, depending if that instance ofCombined
represents anA
orB
data. A way to hide the empty fields would be useful as this can be quite confusing again. - adds complexity in setup and data duplication (copies of
F#
fields fromA
orB
toCombined
) - does not scale very well if
A
andB
are in a bigger set of modules that need this kind of feature. The result is a matrix of all possible record reference fields of which only one has data, with no way of hiding the others.
I would appreciate any hints on what would be the best approach.
Thank you.