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_F1Field_F2Field_A1Field_A2
Module B:
Field_F1Field_F2Field_B1Field_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:
-
Mrecord list can be used to search, filter either (logical) record kinds.
The disadvantage:
- in the record page for the
Mmodule 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
AandB - a type to discriminate
- add a workflow to
afterCreatefor eitherAandBto generate a syntheticCombinedrecord with proper values - add workflow to
afterDelete,afterUpdatefor eitherAandBto manage the correspondingCombinedrecord - limit editing, adding, deleting of
Combined
The advantage:
- record list for
Combinedcan be used to display, filter, search, based onF#fields entries for bothAorB. - record page for
AandBonly 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
AorBto display in the record list or record page ofCombinedto 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 ofCombinedrepresents anAorBdata. 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 fromAorBtoCombined) - does not scale very well if
AandBare 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.