Database Reference
In-Depth Information
Creating Records Through a Portal
Once you've set up a portal on a layout, you can create records without going all the way
back to the Payment layout. On a Lease Agreement record, in Browse mode, click in any
field. You can now tab into the Payment portal's fields, just as if they were a part of the
Lease Agreement table. The fields are active even though there aren't any related records,
because when you defined the relationship between the Lease Agreement and Payment
tables, you chose the option that lets related records be created. View your related table by
choosing Window→New Window. A new window appears that's a duplicate of the original.
Move the new window over to the side so you can see both windows and then switch the
new window to the Payment layout ( Figure 4-13 ).
1. On the Lease Agreement layout, go to Browse mode, click in the Payment
portal's Date Paid field, type a date and then press Tab .
As soon as the insertion point moves to the next field, you'll see the record appear in
the Payment window. Even though you didn't enter it, the new record's agreementID
field now has a value, and it matches the value in the Lease Agreement::agreementID
field.
2. Type a number in the Payment Amount field and then press Tab again .
The agreementID field in the portal is active. Because it's a child record key (some-
times called a foreign key), it's not set up to prohibit data entry. Try this experiment:
Change the number in the Payment::agreementID field (it's in the portal). Click out-
side the portal to commit the change and the Payment record disappears. After you
commit the change, the Payment record is no longer related to the Lease Agreement
record. It might even be related to the wrong parent record now. Luckily you have the
Payment window open, and you can just change the Payment::agreementID informa-
tion back to match the value in the parent record you're viewing. When you commit
the Payment record, it will show back up in the portal.
Use the portal to create a few more payment records just to watch how the process works be-
hind the scenes. Notice how the Tab key travels through the rows in the portal, much as in a
spreadsheet.
Search WWH ::




Custom Search