Difference between revisions of "Subform"

From LongJump Support Wiki
imported>Aeric
imported>Aeric
m (Text replace - 'Designer > Data >' to 'Designer >')
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Designer > Data > Objects > {object} > Forms > {form} > {grid section}'''
'''Designer > Objects > {object} > Forms > {form} > {subform}'''


Grid sections display ''related records'' (records that have a [[Lookup]] to the current record).  
Subforms display ''related records'' (records that have a [[Lookup]] to the current record). They also allow related records to be created, by filling in the subform fields.


For example, Grid Sections might present this kind of information in a record:
For example, a Subform might present this kind of information in a record:
:*Line items in an order
:*Expense line items in an Expense Report object
:*Expense line items in an Expense Report object
:*Line items in a proposal or invoice
:*List of available inventory items
:*List of available inventory items


'''To Add or Edit a Grid Section:'''
;Considerations:
#Click '''Designer > Data > Objects > {object} > Forms > {form}'''
:* The owner of the main record becomes the owner of the related records created by the subform.
 
====To Add or Edit a Subform====
#Click '''Designer > Objects > {object} > Forms > {form}'''
#Choose one of the following options:
#Choose one of the following options:
#*To add a new grid section, click the ''New Grid Section'' link (located in the [[Elements Sidebar]])
#*Click the ''New Subform'' link (located in the [[Elements Sidebar]])
#*To edit an existing Grid section, click the ''Edit'' link in the section heading
#*Or click the ''Edit'' link in a Subform section heading.
#Complete the following information:
#:
#;Name:Section Name
#Fill in the following information:
#;Title: The text to display in the GUI.
#;Section Type:Pre-populated (do not change)
#;Section Type:Pre-populated (do not change)
#Define the grid section by selecting an ''Object Name'' and ''Linking Field''
#;Object Name:The Object records to display in the Subform
#:;Object Name:Select an Object
#;Linking Field:Select the field that does a [[Lookup]] to the current object. (A list is presented, in case there is more than one.)
#:;Linking Field:Select a [[Lookup]] field from the available options
#;Number of Rows:Specify the number of rows to display in the Subform
#;Number of Rows:Specify the number of rows to display in the Grid section
#::* This is the minimum number of number of rows to display.  
#::* This is the minimum number of number of rows to display.  
#::* It defaults to 5 rows. You can specify any value up to 100 rows.
#::* It defaults to 5 rows. You can specify any value up to 100 rows.
Line 27: Line 30:
#;Left Side Image:Optionally, select an image to display to the left of the section
#;Left Side Image:Optionally, select an image to display to the left of the section
#;Right Side Image:Optionally, select an image to display to the right of the section
#;Right Side Image:Optionally, select an image to display to the right of the section
#Use the [[Arrow Button]]s to move fields from the Available Fields list to the Selected Fields list, and to specify their order.<br>The selected fields are displayed in the Grid Section when the form is displayed.
#Use the [[Arrow Button]]s to move fields to the list of Selected Fields list, to specify their order.<br>The selected fields are displayed in the Subform when the form is displayed.
#Click '''[Next]'''
#Click '''[Next]'''
#Optionally, specify summaries (Vertical Totals) for selected columns in the grid and Enable additional computation on a selected field.
#Click '''[Save]'''


====Sorting Rows, Totaling Columns ====


;Specifying Vertical Totals:
The second page of the Subform definition lets you specify sorting and totaling options:
In the Vertical Totals part of a grid section, the numeric and currency fields appear:
#;Sort Settings: Choose the column to sort on, and specify ascending or descending sort.
:[[File:GridTotalFields.png|border]]
#;Column Totals: Select the numeric and currency fields that will be automatically totaled.<br>(Only numeric and currency fields are listed.)
#;Column-Total Adjustments:
#:This section appears when you are totaling currency fields. (Only currency fields are listed.)
#:* Select the currency field that will have additional adjustments applied to it, and specify the adjustments to allow for. (See below)
#Click '''[Save]'''


If you choose one more currency fields, an additional choice appears that lets you specify additional computation for one of them:
====Column-Total Adjustments====
:[[File:GridTotal.png|border]]
If you total one more currency fields, you can elect to apply adjustments to one of them:
 
When you choose to enable additional computation, an additional set of options appears:
:* '''Surcharge -''' Adds a surcharge percentage field to the form.
:* '''Surcharge -''' Adds a surcharge percentage field to the form.
:* '''Discount -'''  Adds a discount percentage field to the form.
:* '''Discount -'''  Adds a discount percentage field to the form, as well as a discount amount.<br> (Either can entered. If an amount is entered, it is saved as a percentage.)
:* '''Tax -'''  Adds a tax percentage field to the form.
:* '''Tax -'''  Adds a tax percentage field to the form.
:* '''Shipping -''' Adds a field for a shipping charge.
:* '''Shipping -''' Adds a field for a shipping charge.


Each selection adds the appropriate fields to the form layout, and does the appropriate calculations:  
Each selection adds the appropriate fields to the form, and does the appropriate calculations to produce a ''net'' total:  
:[[File:GridInForm.png|border]]
:[[File:GridInForm.png|border]]


:;Considerations:
{{DeveloperNote|<br>Fields for Column Totals, Column-Total Adjustments, and the Net Total are added to the original object (the object the Subform is defined on). The field names have the form <tt>grid_{name}_123456...</tt>, where the name might be "discount", "net_total", or "comptn" (for a column total), and where the number at the end is the ID of the object [[Field]].}}
::* All numeric and currency fields are listed (and only those fields).
::*'''Vertical Totals''' can be specified for one or more of those fields
::* The '''Enable Additional Computation''' option can be applied to exactly one of them.
::* That option only appears when a Vertical Total column has been selected for a currency field.
::* Only currency fields can be selected for additional computation.
 
{{DeveloperNote|Vertical Totals and additional-computation fields are added to the original object (the object the grid section is defined on). The field names have the form <tt>grid_{name}_123456...</tt>, where the name might be "discount", "net_total", or "comptn" (for a vertical total), and where the number at the end is a unique identifier in the platform for the grid section in this form.}}

Latest revision as of 23:36, 22 June 2012

Designer > Objects > {object} > Forms > {form} > {subform}

Subforms display related records (records that have a Lookup to the current record). They also allow related records to be created, by filling in the subform fields.

For example, a Subform might present this kind of information in a record:

  • Line items in an order
  • Expense line items in an Expense Report object
  • List of available inventory items
Considerations
  • The owner of the main record becomes the owner of the related records created by the subform.

To Add or Edit a Subform

  1. Click Designer > Objects > {object} > Forms > {form}
  2. Choose one of the following options:
    • Click the New Subform link (located in the Elements Sidebar)
    • Or click the Edit link in a Subform section heading.
  3. Fill in the following information:
    Title
    The text to display in the GUI.
    Section Type
    Pre-populated (do not change)
    Object Name
    The Object records to display in the Subform
    Linking Field
    Select the field that does a Lookup to the current object. (A list is presented, in case there is more than one.)
    Number of Rows
    Specify the number of rows to display in the Subform
    • This is the minimum number of number of rows to display.
    • It defaults to 5 rows. You can specify any value up to 100 rows.
    • If data exists, then all available data is shown, plus an additional 3 empty rows.
    Header Image
    Optionally, select an image to display at the top of the section
    Footer Image
    Optionally, select an image to display at the bottom of the section
    Left Side Image
    Optionally, select an image to display to the left of the section
    Right Side Image
    Optionally, select an image to display to the right of the section
  4. Use the Arrow Buttons to move fields to the list of Selected Fields list, to specify their order.
    The selected fields are displayed in the Subform when the form is displayed.
  5. Click [Next]

Sorting Rows, Totaling Columns

The second page of the Subform definition lets you specify sorting and totaling options:

  1. Sort Settings
    Choose the column to sort on, and specify ascending or descending sort.
    Column Totals
    Select the numeric and currency fields that will be automatically totaled.
    (Only numeric and currency fields are listed.)
    Column-Total Adjustments
    This section appears when you are totaling currency fields. (Only currency fields are listed.)
    • Select the currency field that will have additional adjustments applied to it, and specify the adjustments to allow for. (See below)
  2. Click [Save]

Column-Total Adjustments

If you total one more currency fields, you can elect to apply adjustments to one of them:

  • Surcharge - Adds a surcharge percentage field to the form.
  • Discount - Adds a discount percentage field to the form, as well as a discount amount.
    (Either can entered. If an amount is entered, it is saved as a percentage.)
  • Tax - Adds a tax percentage field to the form.
  • Shipping - Adds a field for a shipping charge.

Each selection adds the appropriate fields to the form, and does the appropriate calculations to produce a net total:

GridInForm.png

Notepad.png

Note for Developers:
Fields for Column Totals, Column-Total Adjustments, and the Net Total are added to the original object (the object the Subform is defined on). The field names have the form grid_{name}_123456..., where the name might be "discount", "net_total", or "comptn" (for a column total), and where the number at the end is the ID of the object Field.