Combination Add/Edit UDMs
 
You can create a UDM node that behaves as both an add node and an edit node. In other words, if it is provided with data when retrieved, it will act as an edit node, otherwise as an add node. To achieve this effect, two things must happen:
The node must be provided with read, write and add modes;
Its 'if retrieval parameters are not available' value must be set to 'ignore and show no data'.
Without the 'add' mode, the node will behave as an edit-only node, which means the following:
On retrieval, it will retrieve data as specified by its retrieval parameters. If one or more parameters are not available, it will behave according to the setting of its 'if retrieval parameters are not available' value.
On submission:
It will require that the primary key of its table record be submitted.  If a primary key is not submitted, a root-child node will throw an exception (regardless of the setting of its 'if retrieval parameters are not available' value). A node that is not a root-child will silently ignore the attempt to modify.
It will modify all (and only) the fields of the record whose primary key is submitted. There is no need to submit all non-nullable values of the record in this case.

With the 'add' mode included, however, its behavior on retrieval is the same, but its behavior on submission changes. If the primary key is submitted, the node behaves essentially like an edit node, except that it requires all non-nullables to be included in the submission. If the primary key is not submitted, the node simply adds the record to the table, after using the table's key generation mechanism (such as select max or getting from an Oracle sequence or a key generator object if one is provided) to generate the key.

To quote an instance, an Edit  UDM for editing contacts will do a double duty. If you invoke it with a parameter, you are editing an existing contact, otherwise you are adding a new contact.

The main advantage of creating this kind of dual-purpose UDM is to reuse code and reduce effort. You expend all this effort to build an edit UDM, so you might as well reuse it for adding new data.