Creating Entities

An administrator can create new entities in Aptify as necessary, based on the requirements of your organization. Note that you should carefully design your entity and application before creating new records in the Entities service.

Aptify offers training courses for Administrators and Developers. Students in these classes gain first-hand experience creating entities in a test environment. Contact Aptify for more information.

The process described in this section serves as an introduction to creating an entity. It does not detail every possible configuration for an Entity. See About the Entities Service Forms for a field-by-field explanation of every option available on an Entities form.

 

This topic covers the following sub-topics:

Note Concerning Entity Cloning and Templates

Aptify discourages clients from using shortcut methods, such as cloning an existing Entities record or using a record template, when creating new entities. These features are not designed to replicate all of the intricate functionality inherent in an Entities record.

Aptify's best practice recommendation is for clients to create all new entities from the ground up based on design documentation that should be written and reviewed prior to creating any new entity.

Creating a New Entity

The following steps provide an overview of the basic process for creating a new Entity record:

  1. Open a new record from the Entities service.
    • The Entities service is located in the Aptify Framework Administration application.
  2. Enter a name for the entity in the Name field.
    • Per Aptify's naming conventions for top-level entities, use spaces in the name. Also, all entity names should be plural.
      • For example, use Sample Services rather than Sample Service.
      • If using Aptify Web Access, there are certain characters that the Aptify Smart Client and SQL Server support in an entity name that are not supported by the entity model used by Aptify Web Access. For example, the smart client and SQL Server support using a dash in the field name (such as PersonID-Name) but C# considers this an invalid Property Name. So, the entity model fails to generate for entities that has dashes in field names for AWA. Therefore, when a Entities record is saved with a name that contains an invalid character for Aptify Web Access, a warning message is displayed alerting the administrator that the name field is invalid for AWA and that the Entity Model generator will fail to generate. An administrator can then choose to save the entity as is or modify the name of the entity so that it conforms to the AWA standard.

    • The entity name should not start with a number. Microsoft SQL server does not allow Database Objects to start with a number.
    • This name automatically appears in the Display Name field when you press the Tab key or select another field.
  3. Edit the Display Name as necessary.
    • For top level entities, this is the name that appears in the Ribbon, Navigation Bar, Folder List, and Services selection dialog.
    • For sub-types, this is the name of the tab on the parent entity's form.
  4. Enter a culture string to use as the display name of the entity in the Display Culture String field if you want to localize this entity name on a user-by-user basis (based on a user's assigned Culture). See Using Localization Administration for details.
  5. Leave Base DSN and Base Database set to APTIFY (the default setting).
    • These fields identify the database where the entity's information, including its table, is stored.
  6. Enter a name for the entity's database table in the Base Table field.
    • During the Save process, Aptify automatically creates a base table for this entity using the name provided. Note that this is assumed that the Generate Table option is selected.
    • Per Aptify's naming conventions for entities, use the singular form of the Name as the Base Table name.
      • For example, if your entity's Name is Sample Services, enter SampleService in the Base Table field.
  7. Enter vw[Entity Name] in the Base View field.
    • Note that for new entities, this field is a text box. It becomes a link box that links to a corresponding Database Objects record after you save the Entities record.
    • As per Aptify's naming conventions for entities, enter vw and then the Name as the Base View name.
      • For example, if your entity's Name is Sample Services, enter vwSampleServices in the Base View field. 
  8. Confirm that the Generate Table and Is Installed options are selected.
    • If the Generate Table option is not selected, the system will not automatically generate the required database objects and form templates.
    • If the Is Installed option is not selected, the entity will not be available to any user.

      New Entities Record

  9. Using the Fields sub-type tab, add one or more fields to the entity.
    • Note that the system creates an ID field automatically.
    • See Defining Entity Fields for information on how to add different types of fields to an entity (such as a text box, a link box, and a combo box).
  10. Click the Configuration tab.
  11. Aptify provides support for multiple filegroups to organize how and where SQL objects are stored within the Aptify database. If applicable, you can assign an entity's objects to a particular filegroup from the File Group drop-down menu. 
    • Once an administrator has created a filegroup with at least one file for the Aptify database within the SQL Server, the filegroup will be available in the File Group drop-down menu.
    • See Creating Multiple Filegroups  for more details.
  12. Aptify also supports the ability to specifically group large text and image fields into a specified filegroup by specifying a filegroup from the Text/Image File Group drop-down menu.
    • If the entity contains a field with a qualifying SQL Data Type, this field is enabled and a filegroup can be selected to manage text and image fields from this menu.
    • See  Adding Text and Images to Filesgroups for more details.
  13. Aptify also supports the ability to display a preview pane at the bottom of list views that provides easy access to a sub-set of information from a particular record by specifying the appropriate form template in the Default Preview Pane link box.

    If the new entity is a sub-type entity, the Order By field is displayed and defines the order in which sub-type records are sorted within a Sub-Type Listing. This field is not visible for Entities records that are not sub-type entities. See Defining the Sort Order for Sub-Type Listings for more details.

  14. By default, Record History are enabled for new entities. If you want to disable Record History for this entity, clear the Track Versions option.
  15. If you want to require users to enter a justification each time a record is created or modified, select the Require Comments for each Save option. See Requiring Comments on Save for more information.
  16. Select the Enable Recordset Query Limitation option if you want to limit the number of records that can appear in a view based on the user's permissions. See the Managing the Recordset Query Limitation for more information.
  17. If you want to allow records from the entity to appear in the Most Recently Used Records component for dashboards, select the Enable Most Recently Used option. See Enabling Support for Most Commonly Used Records for more details.
  18. If you want to configure the label text and background color for required fields, select the Customize Required Field Font Name and Font Color. Four additional fields appear, set the color, font style, size, and background color as desired. See Configuring the Appearance of Required Fields for more information.
  19. Allow Record History Restore is an optional Record History feature that is also enabled by default for new entities. Clear the Allow Record History Restore option if you want to disable this Record History Restores for this entity.
    • Note that the Allow Record History Restore option is not applicable when the Track Versions option is cleared.
    • See Enabling and Disabling Record History for more information on this feature.
  20. Click the Security tab and add permissions for at least one user or group to the new entity.
  21. Click the Applications tab.
  22. Select the Selected column for one or more applications to add the entity to an application.
    • Note that this step is not applicable for sub-types since they do not appear in the Ribbon, Navigation Bar, or Folder List.
  23. Save the entity.
    • Aptify automatically calculates the maximum row size of the entity's tables. If any exceed the row size limit of 8060 bytes, Aptify displays a warning message. See Creating Multiple Base Tables for details.
    • Aptify automatically generates the Base Table(s), Base View, Stored Procedures, and Form Templates for the entity (assuming that the Generate Table option is selected).
    • Aptify also automatically regenerates the spGetDependants stored procedure for entities linked to this new entity. See spGetDependants for details.
    • Aptify automatically generates four Process Components to create, read/load, update, or delete records for this entity (known as the CRUD components). These components simplify Process Flow creation and alleviate the need to write custom components to perform these tasks. See About the CRUD Process Components for more information.
  24. If the new entity is a top-level entity and you want to add a sub-type, click the Sub-Types tab.
  25. Right-click in the gray area and select New from the pop-up menu.
    • A new Sub-Type entity form appears.
  26. Repeat the steps above to create the sub-type entity.
  27. Create additional sub-type records as necessary. When finished, save and close the Entities record.

    Note Concerning Aptify Web Access Entity Naming Validation

    When an Entities record is saved with a field whose name contains an invalid character for Aptify Web Access, a warning message is displayed alerting the administrator that the name field is invalid for AWA and that the Entity Model generator will fail the generate.

  28. Close and relaunch Aptify.
  29. Login as a user who has permissions to the new entity and confirm that the new entity appears as intended.

Creating Multiple Base Tables

Within Aptify, an entity can have multiple base tables. This is particularly useful for complex entities that have a large number of fields and for entities that you want to replicate across servers. When using multiple tables, you can spread the entity's fields across the tables so that the potential row size of any single table does not exceed the SQL Server limit of 8060 bytes.

Note that some planning and an understanding of database updates in wide and narrow tables is required to successfully take full advantage of this feature.

Row Size Limit

The row size limit of 8060 bytes was a hard limit for versions earlier than SQL Server 2005. Attempts to save a record whose size exceeded this limit resulted in an error. With SQL Server 2005 and later, the server can automatically handle situations where the row size exceeds the 8060 bytes without generating the error. However, replication still requires adherence to the 8060-byte limit, so any entity that you intend to replicate must have a maximum row size that is less than the limit. Also, in any case, Aptify recommends designing tables that are less than the 8060-byte limit to ensure optimum performance.

Each time you create a new entity, add a new field, or modify the SQLField Size for an existing field, the system automatically adds up the SQLField Sizes for fields in a particular table to determine if a row in that table could potentially exceed the 8060 bytes limit. If the row size exceeds 8060 bytes, Aptify displays a warning message to notify you that a row in this table could exceed the limit. Note that in this calculation, the field size for unicode character types, such as nchar and nvarchar, is multiplied by 2 since SQL Server uses 2 bytes to encode each unicode character.

Keep in mind that even if you receive the warning message that the table's row size may exceed the 8060-byte limit, a row will only reach this maximum size if a user enters the maximum number of characters for variable length fields. For example, if you have an nvarchar(4000) field in your entity, Aptify will use 8000 bytes for this field when calculating the maximum row size. However, this field will only actually use 8000 bytes if a user enters 4000 characters, which may be unlikely depending on the nature of the field. Also, Aptify supports the nvarchar(max) and varchar(max) data types. In general, you should use one of these data types for fields that can contain large amounts of data. Also, the likelihood of approaching the table size limit is reduced dramatically if you use these max data types in place of large nvarchar or varchar data types. See the About the Supported SQL Data Types for more information on the nvarchar(max) and varchar(max) data types.

Step-By-Step Instructions

If you are creating a complex entity with a large number of fields or if Aptify has warned you that the row size may exceed the 8060-byte limit, you can add additional base tables to your entity.

Follow these steps to add another table to your entity:

  1. Open a new or existing Entities record.
  2. Click the plus (+) sign to the right of the Base Table field to open the Additional Base Table dialog.

    Adding a Base Table
  3. Click the new icon to open a new Additional Base Tables record.
  4. Enter a name for the new table in the Table field.
    • The table's name cannot contain spaces or be a SQL reserved word. See the Microsoft SQL Server Books Online (https://technet.microsoft.com/en-us/library/ms130214(v=sql.105).aspx) for more information on the naming restrictions for tables and other identifiers.
    • Aptify recommends that your table name contain the name of the entity's primary base table and a description of the fields that it will contain, for example, SampleServiceDetailTab.
  5. If applicable, select an alternate filegroup in the File Group field and click OK.
    • Note that the Text/Image File Group field is disabled since no qualifying fields with text or image data types have been added to the table as of yet.
    • See Creating Multiple Filegroups for more information about filegroups.

      Specifying a New Table Name and File Group
  6. Add additional tables as necessary.
    • Alternatively, you can click OK and New in Step 5 to save the current record and open a new Additional Base Tables record in one step.
  7. Click Close to close the Additional Base Tables dialog and return to the Entities record.
  8. Assign one or more fields to the new table. See Defining Entity Fields for details.
  9. Save and close the Entities record.

Notes Concerning Multiple Base Tables

When you add additional base tables to an entity, Aptify automatically handles the integration of multiple base tables for a single entity and generates all of the required database objects, such as stored procedures and a single base view. Keep in mind the following points when working with an entity that contains multiple base tables:

  • The ID field must reside in the main base table.
  • Each record in an entity spans all of the entity's tables. Each table has an ID field. For each record, the ID field is the same value for all of the entity's tables. This links the tables together to form a single record.
  • Any field that links back to a parent ID field, such as in a sub-type entity, must reside in the main base table. See Creating Multiple Filegroups for more information on sub-types.
  • A computed field and all of the fields that are referenced in its calculation must be in the entity's primary base table. See Calculated and Computed Virtual Fields for details.
  • When adding a new field, you can assign it to any of the entity's base tables (keeping in mind the restrictions listed above).
  • After you have saved a field in one table, you can move it to another table, if necessary (keeping in mind the restrictions listed above). Follow these steps to change a field's table assignment:
    1. Open an Entities record.
    2. Open the Fields record for the field whose table you want to change.
    3. Select a different table from the Base Table drop-down list.

      Changing Table -Assignments
    4. Click OK to save the Fields record.
    5. Save and close the Entities record. The field and any data contained in that field moves to the specified table.
  • After you create one or more additional base tables, the plus (plus) sign to the right of the Base Table field on the Entities form changes to a check mark. Click this check mark to open the Additional Base Tables dialog. The dialog reports the other base tables associated with this entity and displays the number of fields that are associated with each table. 
    Additional Base Tables Dialog

Using Multiple Base Views

This topic outlines the multiple base view functionality introduced in Aptify version 5.5.1. This functionality allows organizations to configure additional base views on top-level entities, streamlining the way users access information in Aptify, and improving the view and find performance. Multiple base views can be configured to include fields from other entities, including sub-types, so that users can access information in one view. In addition, multiple base views can use many of the features that an entity's standard base view uses including the Report wizard, messaging, and views (all view types are supported). Multiple base views are similar to virtual entities, but have several advantages:

  • You do not need to create an additional entity to view information across multiple entities. With multiple base views, you simply select the particular base view you want to return information from when running views or finds.
  • You do not have to configure redirect information to open an appropriate form. The service form in which the base view is configured is opened automatically.
  • With virtual entities, you cannot use many of the features that are part of the entity, for example, messaging, mail merge, etc. These features are available with multiple base views. Also, since the base view is configured directly on the entity, you have access to reports without additional configuration.
  • Less Advanced SQL is required for selecting fields across entities. If the base view is configured with the appropriate entities/fields, the fields are already included. Note that additional steps are required when adding fields from entities that do not have a direct relationship to the current entity. See Best Practices for Adding Fields from Entities with Non-Direct Relationships for information.
  • Multiple base views can be used not only with Aptify's viewing functionality, but Aptify's find functionality as well. In addition, an administrator can configure different default base views to be used with a view and find operations on a global, group or per user basis.

 

Note

In Aptify 5.5.2, Aptify updates the multiple base view functionality to include a wizard to simplify the process of creating base views.


The sample base views included are:

  • Persons With Committees: Returns information based on a person's Committees involvement.
  • Persons With Order Meeting Details: Returns information based on a person's meeting registration activity.
  • Orders and OrderMeetingDetail Information: Returns order details related to meeting registrations placed on a given order.
  • Orders and OrderLines Information: Returns order line details for a given order.

The use of multiple base views is described in the following topics:

Creating Multiple Base Views Using the Base Views Wizard

Aptify provides the ability to create base views using the Base Views wizard. Follow the steps below to create additional base views:

  1. Log in as an administrative user.
  2. Go to Framework > Entities and click the New Base View Wizard icon () to launch the wizard. You can access the wizard using one of the following methods:  
    • Running a view of Entities and clicking the icon from the view’s toolbar. If you select the record of a top-level entity before launching the wizard, the name of the entity will be automatically populated in the Entity field.
    • Clicking the icon from the Entity’s entity browser. In this case, you will need to manually enter the name of the entity in which you want to create the base view.
  3. If not already populated, enter the name of the entity in which you want to create the base view in the Entity field.
  4. In the Name field, enter a name for the base view.

    Note

    The base view name must be unique (It should not be the same as another base view in the system) and cannot contain spaces.

  5. In the Base View field, enter a name for the base view that will be generated. This is typically the plural name of the Base View with vw as the prefix.
  6. In the Display Name field, enter a name for the base view that will be displayed.
  7. If you are using localization, enter a culture string in the Display Name Culture String field.
  8. If you want to display a description when using this base view with finds and views, enter this information in the Description field.
  9. If you want a localized version of the description, enter this information in the Description Culture String field.



  10. Click Next. The Fields Info window of the wizard displays, showing a grid that lists the available fields for the selected entity, and a grid that will list the fields selected for this view.



  11. Select the fields that you want to include in your base view from the first grid and click Add to add it to the second grid.
  12. If you want to add fields from another entity to your base view, select another entity from the Entity drop-down menu, and repeat Step 11. 

    Note

    The entities in the drop-down menu are listed in order of their relevance to the originally selected entity, with those entities with a direct relationship with the originally selected entity being listed first. See Best Practices for Adding Fields to a Base View from Entities with Non-Direct Relationships for more details about the steps needed to add fields that do not have direct relationships to the current entity. 




  13. Click Next and the new base view is created. 



  14. Click Finish to close the wizard.

 

You can review and make changes to the base view by going to the Base Views tab of the entity in which you created the alternate base view. You can also:

Creating Multiple Base Views Manually

In Aptify, you can create multiple base views. Follow the steps below to create additional base views manually:

  1. Log in as an administrative user.
  2. Go to Framework > Entities and open the top-level entity in which you want to create another base view.
  3. Go to Base Views tab and open a new Base Views record.
  4. On the General tab, enter a Name for the base view.

    Note

    The base view name must be unique (It should not be the same as another base view on the entity) and cannot contain spaces.

  5. Enter a Display Name for the base view.
  6. If using localization, enter a culture string in the Display Name Culture String field.
  7. Enter a name for the base view that will be generated. 
    • This is typically the plural name of the Base View with vw as the prefix. 



  8. If you want to specify permissions for this base view that is different from the permission for the entity itself, select the Base View Security option. Then use the Group Permissions and/or User Permissions tabs to configure the appropriate permissions.

    Note

     If you select this option without specifying information on the User Permissions and/or Group Permissions tabs, the base view will be disabled for all users.

  9. If you want to display a description when using this base view with finds and views, go to the Description tab and enter a short Description and, if desired, a localized version in the Description Culture String



  10. Go to the Fields tab and open a new Fields record.

    Note

    Make sure the Is Name field for the current entity is added as a field. This ensures that operations like executing a find from a link box work as expected.

  11. Enter a Name for the field.

    Just like entity fields, the name for the base view field cannot contain spaces.

    Note

    Once the Fields record is saved, the name of the base view field cannot be modified, and the field is disabled. 

  12. Enter a Display Name for the field.
  13. If using localization, enter a culture string in the Display Name Culture String field.
  14. If you are adding a field that is part of the current entity or another entity, select the Entity from the drop-down. If specifying a calculated field, leave the Entity field drop-down blank and select Calculated from the Field Type drop-down field.
    • If the field you are adding is from the current entity, the Field Type field is populated with Entity.
    • If the field you are adding is from another entity, the Field Type field is populated with Joined.
    • Entities that have a direct relationship to the current entity are listed first in the Entity drop-down.

      Important Note

      If there is no direct relationship from the current entity to the entity with the field in which you want to add, prerequisite steps are required. Attempting to save the base view without performing these steps will cause the save to fail. See Best Practices for Adding Fields to a Base View from Entities with Non-Direct Relationships for more information. 

  15. Select the name of the field from the Entity Field drop-down.

    The characteristic(s) for the field (SQL Data Type, SQL Field Size, SQL Allow Null, Default In View, Show in Find and Width) populate automatically via flow down.

    Note

    You can modify accordingly, however, keep in mind that certain changes may have undesirable affects (for example, reducing the field size). Aptify recommends using the default field characteristics whenever possible.




  16. If you specified a field from another entity, the Field Type field is populated with Joined and the Joined tab is enabled. Select the Joined tab and specify the appropriate Join Foreign Key and Join Type.
  17. If you specified Calculated as the Field Type, the Calculated tab is enabled. Select the Calculated tab and specify the appropriate Calculated Field Expression.
  18. If you want the field to be specified in Select Fields list of a view by default, select the Default In View option.
  19. If you want the field to be part of find results by default, select the Show In Find option.
  20. Click OK to save the Fields record.
  21. Follow Steps 10 through 18 above to add additional fields as necessary.
  22. Once all the appropriate fields have been added, you can add filters to further define the results that are returned with the base view. To do so, select the Filters tab on the Base Views record and add the appropriate filters.
    • Creating filter rules for Base Views records is similar to creating filters for views. See Defining View Filters for more details.
    • Once a filter is applied, the logic is displayed on the General tab as a disabled field. 
  23. Click OK to save the Base Views record.
  24. Save the Entities records.
    • The base view is generated and is ready for use for finding and view operations for the particular entity.

Configuring a Default Base View

In Aptify, you can configure default base views to use when running a find for a particular service or when creating new views. This allows an organization to streamline what fields users have access to when running finds and/or views. Follow the steps below to configure default base views for an entity.

  1. Log in as an administrative user.
  2. Go to Framework > Entities and open the top-level entity in which you want to create another base view.
  3. Go to Base Views tab and open a new Default Base Views record.
  4. Select the Base View you want to set as the default from the drop-down.
  5. Select the Default Type, options are as follows:
    • Global â€“ View will be default for all users.
    • User â€“ View will be default for a particular user, user must be specified in the User field.
    • Group â€“ View will be default for a particular group, group must be specified in the Group field.
  6. If you want to specify this base view as the default view that is selected when creating views, select the Applies To Viewing Systems option.
  7. If you want to specify this base view as the default view that is selected when running finds, select the Applies To Find option. 



  8. Click OK to save and close the Default Base Views records.
  9. Repeat the steps above for additional Default Base Views records as needed. When creating additional Default Base Views, keep the following in mind:
    • Note that if no default base view applies to the views or finds, the entity's standard base view is used as the default.
    • If more than one Default Base Views record is specified with the same permissions but for a different base view, the topmost record takes precedence.

Best Practices for Adding Fields to a Base View from Entities with Non-Direct Relationships

This topic outlines the steps required when adding fields to a base view that are from entities that do not have a direct relationship from the current entity. This includes sub-types that do not have a first level relationship with the current entity (i.e., second and third level sub-types).

Note

Attempting to save the base view without performing the steps below may cause the save to fail.

 

  1. Create the base view as described above for the fields that you want to include that do have direct relationships or are part of the current entity.
  2. Save the Base Views record and the base view's entity to generate the base view.
  3. Open the base view Database Objects record and add the appropriate SQL (joins, fields, etc.) to specify the additional fields that do not have the direct relationship.

    Note

    The Database Objects record must be non-generated.

  4. Save the record.
  5. To ensure the metadata is created for the new fields, go back into the Base Views record and create Fields records for the fields that you manually added to the Database Object.
  6. Click OK to save Base Views record.
  7. Save the Entities record.

See the Persons With Committees sample base view on the Persons entity for an example of a base view that has fields linked to non-direct entities.

Note Concerning List View Hyperlink Functionality for Non-Direct Fields and Multiple Base Views

Aptify has the ability to display fields linked to other services as hyperlinks. However, this functionality is not supported for base view fields that do not have a direct relationship to the current entity. In this case, the field displays as a normal field, even when the Hyperlink option is checked. See Enabling or Disabling Hyperlinks for Fields in a List View for more information about this feature.

 

Using Multiple Base Views with Finds

In Aptify, once an additional base view has been created, users who have appropriate permissions can run find queries against the alternate base view. When using the Basic Find dialog from a view's toolbar, entity browser, or any other location in the Aptify application, a user can specify which base view to use from the drop-down shown below.


When using the Advanced Find dialog, a user specifies the base view to use from the Base View drop-down. In addition, you can view a description of the base view by hovering over the information icon shown below.

Creating Views with Multiple Base Views

In Aptify, once an additional base view has been created, users with appropriate permissions can create views based on the alternate base view. When creating a view, a user selects the appropriate Base View from the Base View drop-down list and configures the view as desired. If a default base view is configured, it is automatically selected.
 

Note

Once a view has been created, the Base View field is disabled and cannot be modified.

After selecting a particular base view, the fields defined in that view are available for selection on the Filters and Fields tabs of the Create Views dialog.

Creating Multiple Filegroups

Aptify provides support for SQL filegroups to allow administrators to create multiple filegroups to manage entities and indexes within Aptify. Leveraging the use of filegroups can have its advantages especially for large databases that are transaction driven. Dividing data and separating objects into different groups can improve performance and data organization as well as assist with backup, archival, and recovery management.

Note that an understanding of database/hardware design and your organization's needs is required to successfully take full advantage of this feature.

Filegroups are created at the SQL server level. Refer to Microsoft's online Help for information on how to create filegroup and add files with SQL Server Management Studio.

There are several ways to add entities and indexes to filegroups in Aptify:

Adding Entities to Filegroups

Follow these steps to add a new or existing entity to a filegroup:

  1. Open a new or existing Entities record.
  2. Open the Configurations tab.
  3. Using the drop-down menu, choose the filegroup for this entity from the File Group field.
    • The default PRIMARY filegroup defined in SQL Server for the Aptify database is populated by default.
  4. Add additional information to the Entities record as necessary.
  5. Save and close the Entities record.

Adding Additional Base Tables to Filegroups

Within Aptify, an entity can have multiple base tables that can be added to different filegroups. Follow these steps to add a newly added base table to a filegroup:

  1. Open a new or existing Entities record.
  2. Open a new Additional Base Tables record and enter a name for the new table in the Table field.
  3. Select a filegroup in the File Group field and click OK.
    • Note that the Text/Image File Group field is disabled since no qualifying fields with text or image data types have been added to the table as of yet.
  4. Add additional tables as necessary.
  5. Click Close to close the Additional Base Tables dialog and return to the Entities record.

Adding Text and Images to Filesgroups

Aptify extends filegroup management by adding the ability to specifically group large text and image fields into a specified filegroup. If the entity contains a field with the SQL Data Type of nvarchar(max), varchar(max), ntext, or text, a filegroup can be selected to manage these text and image fields.

Follow these steps to add text and images to a filegroup:

  1. Open a new or existing Entities record.
  2. If not already done, add a field (or fields) to the Fields tab that meets the qualifying criteria.
    • Only fields with the SQL Data Type of nvarchar(max), varchar(max), ntext, and text can be stored in the specified filegroup.
    • See Defining Fields for details on how to add fields to an entity.
  3. Open the Configurations tab.
  4. Using the drop-down menu, choose the filegroup for nvarchar(max), varchar(max), ntext, and text fields from the Text/Image File Group field.
    • The default PRIMARY filegroup defined in SQL Server for the Aptify database is populated by default.
    • Note the filegroup to manage large text and images does not necessarily need to be different from the filegroups that manage the rest of the database data.
  5. Add additional information to the Entities record as necessary.
  6. Save and close the Entities record.

Creating Sub-Type Entities

Aptify simplifies the process of creating sub-type entities by automatically adding three required fields when you open a new sub-type record. This applies to first level sub-types and nth level sub-types (for example, a second level sub-type is a sub-type of a first level sub-type). For example, PersonCompanyFunctions is a second level sub-type; Persons is the top-level Entity, PersonCompanies is the first level sub-type, and PersonCompanyFunctions is the second level Sub-Type.

Follow these steps to create a sub-type entity:

  1. Open the Entity record for which you want to create a sub-type.
  2. Click the Sub-Types tab.
  3. Right-click in the gray area and select New from the pop-up menu.
    • The system opens a new Sub-Type entities record that includes three automatically generated fields:
      • ID: ID field for records in this sub-type.
      • [ParentEntity]ID: Field that links to the parent entity's ID field.
      • Sequence: Field that records the order in which the sub-type records appear in a sub-type listing.

    New Sub-Type Form

  4. Complete the necessary fields to define the sub-type entity. See Creating a New Entity and About the Entities Service Forms for more information on the available fields in an Entities record. Keep in mind the following when working with sub-type records:
    • Name: Per Aptify's naming conventions for sub-type entities, use the following convention:
      • [Top Level Entity Name Singular][Sub-Type Name Plural] with no spaces.
      • For example, use SampleServiceOptions, where Sample Services is the top-level entity and Options is the sub-type identifier.
    • Display Name: For sub-types, this is the name of the tab that will appear on the parent entity's form.
    • Base Table and Base View: Specify a Base Table name and Base View name following the standard Aptify convention (described in Creating a New Entity.
      • Note that for new sub-type entities, this field is a text box. It becomes a link box that links to a corresponding Database Objects record after you save the Entities record.
    • Multiple Base Tables: Sub-type entities support multiple base tables, just like top-level entities. See Creating Multiple Base Tables for details.
    • Security: Sub-type records do not automatically inherit the security settings of the parent entity. You must configure the sub-type security settings.
  5. Click Save when you have finished defining the sub-type (that is, you have completed the top area of the Entities form, added the necessary fields and defined Security permissions).
    • When you save a sub-type entity, the parent entity is automatically saved as well. The system also automatically regenerates an entity's database objects as needed and regenerates the entity's form to include a tab for the new sub-type entity.

Defining the Sort Order for Sub-Type Listings

In Aptify, records associated with sub-type entities can only be accessed through a Sub-Type tab from the current service (entity). This information is displayed using the Sub-Type Control as a list of records. By default, the records within the grid are sorted by the sub-type entity's Sequence field is ascending order. However, in some cases, sorting by sub-type sequence may not make appropriate. Therefore, Aptify allows an administrator to modify the sort order when applicable.

This behavior is controlled by the Order By field which is found on the Configuration > General tab of a Entities record that is a sub-type. By default, the Order By field sorts the records by the ID field linked to the parent record and the sub-type entity's Sequence field.

An administrator or developer can use the AllowSort input property to configure the sorting behavior within a sub-type grid. However, this only applies to the record that is currently opened. When the record is closed and re-opened or another record is opened in the same service, the order in which the sub-type records appear defaults to the value defined by the administrator or developer in the sub-type entity's Order By field. See Working with Form Tabs for more details.


The figure below depicts the default value of the Order By field for the PersonsCompanies sub-type entity (which displays the companies in which a person has a relationship on a Persons record's Details > Companies tab).

Example of Default Order By Syntax

An administrator can define an unlimited number of sort order levels for records within a sub-type grid by modifying the sort criteria within the Order By field using the following syntax:

First Level Field Name to Sort By DIRECTION(ASC|DESC), Second Level Field Name to Sort By DIRECTION(ASC|DESC),etc.

In the figure below, the Order By field has been modified to the first sort, in descending order, the records within the PersonsCompanies sub-type grid by the Title that describes the person's role at the specified company, and then in ascending order by the name of the associated Company.

Modified Sort Order for the PersonsCo mpanies Sub-Type Listing

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.