Using Cases to switch Form Models

I was wondering if it is possible to use Cases in the Application Model to switch between two Form Models and therefore present the same document differently?

  1. Navigate to the Module
  2. Create a new document or open an exisiting one
  3. Present document using the default Form Model
  4. User can switch between the options in the sidebar

grafik

My actual use-case is that I want to be able to:

  1. Create relationship links with link documents easily and
  2. Compute using all the data in my data graph.

“1.” is most easily achieved with “standard” bindings as I only need to edit the Fields of the Link Document and these can be shown in a pop-up.
“2.” can only be achieved with a CDM and a CDM-based Form (which forces you to edit the Fields of the Link Document on the detached repeat screen).

As a result, I thought about using two different Form Models. A “standard” Form to create the links and enter the Link Document data and then a CDM based Form for the computations.

I’m sure that there will be problems with the data loading when switching between the FM and CFM but I can’t get my minimal models to work:
DM.json (1.3 KB)
FM1.json (2.3 KB)
FM2.json (2.3 KB)
OM.json (1.9 KB)
PreviewApp_AM.json (6.2 KB)

Have I made an incorrect assumption about Cases? done something wrong? found a bug? :person_shrugging:

Hi Malcolm,

What you want to achieve should be a CDM feature. With the new dynamic app config, we have the basic mechanism in place to implement such features. A small catch: It would probably be best to implement it on top of / after “Master/Detail Component” (A12-15815).

Regarding your idea to use app model cases as a workaround: The “case” feature itself is exactly provided for your use case (switching between multiple views on the same data). However, as the form engine has a lot of data-features (initial values, dependencies, …), which are implemented on an Activity-level, it is currently not possible to use multiple form models in the same Activity. For that, those data behaviors would need to be separated from the Form Engine / Model (which I think is a good idea, in principle).

Thanks for the answer. If I create a requirement ticket for either of your points:

  1. Extending CDM Bindings to allow pop-ups for Link Documents
  2. Allowing Multiple Form Models to be used with the same activity (after the data-features have been clarified)

I’ll try and remember to point the ticket numbers here.

There’s an existing ticket relating to this, A12-13385 and thread Additonal link document in CDM