|
Creating a Form - Parents &
Bodies
If you are familiar with creating forms using previous versions of
CAPITAL or have used report writers in the past, then you are
likely to be familiar with the concept of "bands". These are the
sections of a page that a report or form can be broken up into. A
typical form or report has this arrangement:
Notice that in CAPITAL the header (top section) and footer (bottom
section) of the report are combined together and form what is
called the Parent. The parent body is sometimes
referred to as the "container form".
If the form you are editing is an invoice then it would typically
have a name/address details section at the top (the header), the items sold (the body) and any
comment lines and totals at the bottom (the footer).
This middle section containing the list of sale items is also the
first body. In Visual Builder it is referred to as Body 1. CAPITAL can support as many body sections
as are required, although it would be rare to have more than one
body on a document such as an invoice.
This may not be the case for a different type of form. For example,
the job card of the Service Manager might have header and footer
sections plus a "materials/parts used" section and a "labour/time"
section. This would require three sections. The Parent (the
header/footer), Body 1 (the materials/parts used list) and Body 2
(the time sheet info).
Creating the Form
Use the
Form
Wizard to create the basic lay-out of the form for you.
Initially, the Form Wizard does two important tasks:
-
It gathers together all the databases that are
required to represent the information you wish to show.
-
It connects a "dictionary" to the form. A
dictionary is a list of predefined field
codes that you can drop onto the form to represent the information
you want.
Arranging Fields in their Correct Sections
Most of the objects you'll wish to place
on the form are quite straightforward to manipulate. The mistake
you are most likely to make is to place a field on the form and
assign it to the wrong section or body.
The field code PCODE is normally used by CAPITAL
as short-cut to represent the "product code". A product code
doesn't belong in the header section where address details are
found or at the bottom of the form where totals are placed. It is
obviously related to the stock items that are sold and should
therefore be assigned to Body 1. Anything that appears repeatedly
on a form probably belongs in Body 1.
The Parent Body
Let's, for the sake of an example, consider tax rates. What about
something like TAXCODE? Where should it be
placed? In the Parent (top or bottom section) or in Body 1?
This would depend on what TAXCODE represents. If it
represents the tax number, then it belongs to the Parent. This is
because there is only one tax number per invoice transaction. It
only needs to be printed once at a fixed location on the form. (An
exception would be if the form contains a tear-away or fold over
section, in which case it might need to appear more than once.
However, there is still only one tax number involved, it just
happens to be printed twice.)
Other fields that would normally only appear once include the
account code, account name, account address, delivery address,
invoice total, sales tax sub-total, and so on. These field codes,
therefore, belong to the entire transaction, and should be placed
in the parent.
But what if TAXCODE referred to the tax rate
of each individual sale item found on the invoice? (Sale items will
appear many times on an invoice, with each different from the
other.) It would then be placed in Body 1 where it would go
alongside the product code, product description, product quantity,
etc. As there can be many products per invoice, it would be
ambiguous to place it anywhere else--the user reading the form
would be unable to tell which item TAXCODE
referred to.
|