|
Here's
a short note on building an order-entry UDM. Let's
suppose you have a header table H and a detail table D,
and you want to add one record into H and five
corresponding records into D.
|
|
|
|
1
|
Create
an add node for H.
|
|
2
|
Add
a child to this node, one that uses the Integer sequence
data port. Tell it that the starting value is 0, the
ending value is 4 and the increment is 1 (or some such
combination to make it generate five values).
|
|
3
|
To
the latter node, add a child that is an add node for the
table D.
|
|
4
|
Bind
the foreign key for this last node to the primary key of
the node for table H.
|
|
5
|
Generate
your HTML.
|
|
|
|
|
That's
it. Basically the server side looks for the primary key
of the record to be edited/added. If it finds that the
primary key was submitted, it treats the request as one
for editing the record. If no primary key was submitted
(but all non-nullable columns were), it treats the
request as one for adding a new record. You can exploit
this server-side behavior to create HTML pages that use
DHTML to dynamically add new records, varying the number
of records being added from the same HTML page.
|