Switch to Create Mode in a Rich Client Subform when Empty Dataview Is Yes (Magic xpa 4.x)
This Technical Note explains how to switch to Create mode in a Rich Client subform when the Allow Empty Dataview task property is set to Yes.
In a Rich Client program containing a subform, you cannot park in a subform and switch to Create mode by pressing F4 (Create Line action) when the Allow Empty Dataview property is set to Yes and there are no records in the view. (However, this can be done while in Online mode.)
The scenario described above is considered as the definition in RIA because all forms (including the Subform control) belong to the same logical record. (The subform is an "extension" of the parents' data view.)
There are two ways to switch to Create mode:
-
Set the Allow Empty Dataview task property to No for the subforms' task.
-
Set the Allow Empty Dataview task property to Yes, you need to add special logic:
-
Create a Virtual variable and set the Part of Dataview property to No.
-
Place the Virtual variable on the subform. The cursor will be parked on this control (in the subform), allowing you to switch to Create mode.