AgileApps Support Wiki Pre Release

Difference between revisions of "Subforms"

From AgileApps Support Wiki
imported>Aeric
 
(129 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Designer > Data > Objects > {object} > Forms > {form} > {grid section}'''
<noinclude>
'''[[File:GearIcon.png]] > Objects > {object} > Forms > {form} > {subform section}'''


Grid sections display ''related records'' (records that have a [[Lookup]] to the current record).  
__TOC__</noinclude>
====About Subforms====
Subforms give users a way to view, modify, and add related records. Subforms can be used in both [[Forms]] that run in the platform, and in [[Web Forms]] that run externally.


For example, Grid Sections might present this kind of information in a record:
For example, a subform might be used for:
:*Line items in an Order form
:*Expense line items in an Expense Report object
:*Expense line items in an Expense Report object
:*Line items in a proposal or invoice
:*A list of available inventory items
:*List of available inventory items


'''To Add or Edit a Grid Section:'''
In a Form that is displayed the platform, a subform does all of the above, plus:
#Click '''Designer > Data > Objects > {object} > Forms > {form}'''
:* A subform displays a grid of fields for a ''related object'' (an object that has a [[Lookup]] to the current object).
#Choose one of the following options:
:* Existing records that have a [[Lookup]] to the current record are automatically displayed.
#*To add a new grid section, click the ''New Grid Section'' link (located in the [[Elements Sidebar]])
:* Those records can be modified and sorted.
#*To edit an existing Grid section, click the ''Edit'' link in the section heading
:* Column totals can be displayed for number and currency fields.
#Complete the following information:
:* New related records are added by providing data for empty rows in the grid.
#;Name:Section Name
 
#;Section Type:Pre-populated (do not change)
When the platform processes the data in the subform, the new related records are created. The Lookup field in those records (also known as the ''Linking field'') is automatically populated. (In a Web Form that runs externally, everything operates the same, with the exception that existing records cannot be displayed, and there are no column totals.)
#Define the grid section by selecting an ''Object Name'' and ''Linking Field''
 
#:;Object Name:Select an Object
;Considerations:
#:;Linking Field:Select a [[Lookup]] field from the available options
:* The owner of the main record becomes the owner of the related records created by 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.  
:* Formula fields, Image fields, and File fields cannot be included in the subform.
#::* 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.
:* The ''Linking Field'' (the Lookup field defined in the subform object) should not be selected for inclusion the list of subform fields. (That field is included automatically when the subform is displayed. It should not be present in the subform, so that it cannot be changed accidentally.)
#;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
:* Subforms are not supported in the mobile interface.<br>(If form contains a subform section, that section does not appear when the form is displayed on a mobile device.)
#;Left Side Image:Optionally, select an image to display to the left of the section
:* Subforms are supported for objects you create, and for the [[Cases object]]. They are not available for most other (mostly hidden) supporting [[System Objects]]. (In particular, they are not available for the Tasks object.)
#;Right Side Image:Optionally, select an image to display to the right of the section
:* Column total calculations are performed on records that are added, changed, or deleted within the subform section. If a record is added outside of the subform, column totals will not be accurate.
#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.
:* For that reason, an Object used in a subform should not be displayed in an [[Application Tab]].
#Click '''[Next]'''
 
#Optionally, specify summaries (Vertical Totals) for selected columns in the grid and Enable additional computation on a selected field.
{{Tip|Once an object is chosen for use in a subform, got to the [[Tab Preferences]] page and remove it from all roles. Then it will not be available for use as an Application Tab.}}
 
:* Subform within a subform is not supported.
 
:* The list of subform records inside the record view of the Parent object is visible only when the ‘Record View Action’ in the Custom Access Criteria is true.
{{Note| To view the subforms through the Parent Object record, the applicable Custom Access Criteria will be Record View Action and not List View Action.}}
 
====Using Subforms====
'''To add a record to a subform:'''
# If record details are not already displayed, click '''- View Details -'''.
# If the subform tab is not currently selected, click the tab that contains it.
# At the top right of the subform section, click '''[Add Record]'''.<br>A dialog appears, displaying a data-entry [[Form]] for that object.
# Fill in values for the record.
# In the dialog, click '''[Save]'''.
 
'''To edit an existing record displayed in a subform:'''
# If record details are not already displayed, click '''- View Details -'''.
# If the subform tab is not currently selected, click the tab that contains it.
# In that tab, click on a subform record.<br>The edit dialog opens.
# Make your changes.
# In the dialog, click '''[Save]'''.
 
'''To delete subform records:'''
# If record details are not already displayed, click '''- View Details -'''.
# If the subform tab is not currently selected, click the tab that contains it.
# Next to the record(s) to be deleted, click the check box under the trash can icon.
# Click '''[Save Changes]'''.<br>The records are deleted, and any other changes made in the form are saved.
 
====Working with Subforms====
To add or edit a subform:
#Go to '''[[File:GearIcon.png]] > Objects > {object} > Forms > {form}'''
#:a. To create a new subform:
#::In the '''Elements''' sidebar, click '''New Subform'''.
#:b. To edit an existing subform:
#:: In the subform section heading, click the Edit icon.
#Fill in the subform settings:
#:
#* '''Basic 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.
#:
#*'''Layout'''
#: This section is present for a form that is displayed in the platform. It is not present for a [[Web Form]].
#:* ''' Subform Position-'''
#:*: Choose to embed the subform at the bottom of the previous form section, or have it appear as a tab-section in the form.
#:* ''' Form for New Records-''' Choose the related object form to be displayed in the popup that appears when the user clicks the button to add a new record. The form assignment is applicable only for the normal forms. For a subform, the form that you select in the '''Form for New Records''' field, overwrites the selections made in the Forms Assignment page.
#:* ''' Fields to Display in Subform-'''
#::* Choose the fields to display in the table of related records displayed in the subform.
#::* Use the [[Arrow Button]]s to move fields to the list of Selected Fields and to specify their order.<br>The selected fields are displayed in the Subform when the form is displayed.
# Click '''[Next]'''.<br>The second page of the subform definition appears.
# Specify the '''Sorting and Totaling options'''.
#:;Sort Settings: Choose the column to sort on, and specify an ascending or descending sort.
#:;Column Totals: Select the numeric and currency fields that will be automatically totaled.<br>(Only numeric and currency fields are listed.)
#Click '''[Save]'''
#Click '''[Save]'''


{{DeveloperNote|<br>Column Total fields are added to the original object (the object the subform is defined on). The field names have the form <tt>grid_comptn_123456...</tt>, where the number at the end is the ID of the object field.}}
====Dynamic Sorting in Subforms====
AgileApps new user interface now supports dynamic sorting in Subforms. This functionality provides you with a means of header based sorting on table column headers.


;Specifying Vertical Totals:
:* You can sort the records by clicking on the column header.
In the Vertical Totals part of a grid section, the numeric and currency fields appear:
::[[File:Dynamic sort 7.png|1024px]]
:[[File:GridTotalFields.png|border]]
:* Sorting order is indicated by the sorting icon against the column header.
::[[File:Dynamic sort 2.png|1024px]]
:* Default sorting is as per the configuration in settings. Dynamic sorting functionality does not have any impact on the original sorting implementation.
::[[File:Dynamic sort 6.png|1024px]]
{{Note|Sort cycles through ascending and descending.}}
{{Note|Subform sorting takes place at user interface level, you may experience a few differences when compared against API driven sorting. Sorting is case insensitive.}}


If you choose one more currency fields, an additional choice appears that lets you specify additional computation for one of them:
====Subform record operations ====
:[[File:GridTotal.png|border]]


When you choose to enable additional computation, an additional set of options appears:
In the new user interface, Edit and Delete options are available under Actions column of the subform section in the main record. Click  [[Image:Faq horizontal dots.png]] to see View details and Delete options. View details has two options, Read and Update. These options are usable only if the user has the required access to the object used in the subform.
:* '''Surcharge -''' Adds a surcharge percentage field to the form.
:* '''Discount -'''  Adds a discount percentage field to the form.
:* '''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 layout, and does the appropriate calculations:
[[File:Subforms NewUI.png]]
:[[File:GridInForm.png|border]]


:;Considerations:
<noinclude>
::* 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|<br>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.}}
[[Category:Design]]
</noinclude>

Latest revision as of 05:18, 14 July 2022

GearIcon.png > Objects > {object} > Forms > {form} > {subform section}

About Subforms

Subforms give users a way to view, modify, and add related records. Subforms can be used in both Forms that run in the platform, and in Web Forms that run externally.

For example, a subform might be used for:

  • Line items in an Order form
  • Expense line items in an Expense Report object
  • A list of available inventory items

In a Form that is displayed the platform, a subform does all of the above, plus:

  • A subform displays a grid of fields for a related object (an object that has a Lookup to the current object).
  • Existing records that have a Lookup to the current record are automatically displayed.
  • Those records can be modified and sorted.
  • Column totals can be displayed for number and currency fields.
  • New related records are added by providing data for empty rows in the grid.

When the platform processes the data in the subform, the new related records are created. The Lookup field in those records (also known as the Linking field) is automatically populated. (In a Web Form that runs externally, everything operates the same, with the exception that existing records cannot be displayed, and there are no column totals.)

Considerations
  • The owner of the main record becomes the owner of the related records created by the subform.
  • Formula fields, Image fields, and File fields cannot be included in the subform.
  • The Linking Field (the Lookup field defined in the subform object) should not be selected for inclusion the list of subform fields. (That field is included automatically when the subform is displayed. It should not be present in the subform, so that it cannot be changed accidentally.)
  • Subforms are not supported in the mobile interface.
    (If form contains a subform section, that section does not appear when the form is displayed on a mobile device.)
  • Subforms are supported for objects you create, and for the Cases object. They are not available for most other (mostly hidden) supporting System Objects. (In particular, they are not available for the Tasks object.)
  • Column total calculations are performed on records that are added, changed, or deleted within the subform section. If a record is added outside of the subform, column totals will not be accurate.
  • For that reason, an Object used in a subform should not be displayed in an Application Tab.

Thumbsup.gif

Tip: Once an object is chosen for use in a subform, got to the Tab Preferences page and remove it from all roles. Then it will not be available for use as an Application Tab.

  • Subform within a subform is not supported.
  • The list of subform records inside the record view of the Parent object is visible only when the ‘Record View Action’ in the Custom Access Criteria is true.

Notepad.png

Note: To view the subforms through the Parent Object record, the applicable Custom Access Criteria will be Record View Action and not List View Action.

Using Subforms

To add a record to a subform:

  1. If record details are not already displayed, click - View Details -.
  2. If the subform tab is not currently selected, click the tab that contains it.
  3. At the top right of the subform section, click [Add Record].
    A dialog appears, displaying a data-entry Form for that object.
  4. Fill in values for the record.
  5. In the dialog, click [Save].

To edit an existing record displayed in a subform:

  1. If record details are not already displayed, click - View Details -.
  2. If the subform tab is not currently selected, click the tab that contains it.
  3. In that tab, click on a subform record.
    The edit dialog opens.
  4. Make your changes.
  5. In the dialog, click [Save].

To delete subform records:

  1. If record details are not already displayed, click - View Details -.
  2. If the subform tab is not currently selected, click the tab that contains it.
  3. Next to the record(s) to be deleted, click the check box under the trash can icon.
  4. Click [Save Changes].
    The records are deleted, and any other changes made in the form are saved.

Working with Subforms

To add or edit a subform:

  1. Go to GearIcon.png > Objects > {object} > Forms > {form}
    a. To create a new subform:
    In the Elements sidebar, click New Subform.
    b. To edit an existing subform:
    In the subform section heading, click the Edit icon.
  2. Fill in the subform settings:
    • Basic 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.
    • Layout
    This section is present for a form that is displayed in the platform. It is not present for a Web Form.
    • Subform Position-
      Choose to embed the subform at the bottom of the previous form section, or have it appear as a tab-section in the form.
    • Form for New Records- Choose the related object form to be displayed in the popup that appears when the user clicks the button to add a new record. The form assignment is applicable only for the normal forms. For a subform, the form that you select in the Form for New Records field, overwrites the selections made in the Forms Assignment page.
    • Fields to Display in Subform-
    • Choose the fields to display in the table of related records displayed in the subform.
    • Use the Arrow Buttons to move fields to the list of Selected Fields and to specify their order.
      The selected fields are displayed in the Subform when the form is displayed.
  3. Click [Next].
    The second page of the subform definition appears.
  4. Specify the Sorting and Totaling options.
    Sort Settings
    Choose the column to sort on, and specify an ascending or descending sort.
    Column Totals
    Select the numeric and currency fields that will be automatically totaled.
    (Only numeric and currency fields are listed.)
  5. Click [Save]

Notepad.png

Note for Developers:
Column Total fields are added to the original object (the object the subform is defined on). The field names have the form grid_comptn_123456..., where the number at the end is the ID of the object field.

Dynamic Sorting in Subforms

AgileApps new user interface now supports dynamic sorting in Subforms. This functionality provides you with a means of header based sorting on table column headers.

  • You can sort the records by clicking on the column header.
Dynamic sort 7.png
  • Sorting order is indicated by the sorting icon against the column header.
Dynamic sort 2.png
  • Default sorting is as per the configuration in settings. Dynamic sorting functionality does not have any impact on the original sorting implementation.
Dynamic sort 6.png

Notepad.png

Note: Sort cycles through ascending and descending.

Notepad.png

Note: Subform sorting takes place at user interface level, you may experience a few differences when compared against API driven sorting. Sorting is case insensitive.

Subform record operations

In the new user interface, Edit and Delete options are available under Actions column of the subform section in the main record. Click Faq horizontal dots.png to see View details and Delete options. View details has two options, Read and Update. These options are usable only if the user has the required access to the object used in the subform.

Subforms NewUI.png