Adding Agency Fields

Your agency can add additional fields to the system. When you add an agency field you must modify the database as well as the custom business metadata.

Follow these steps to add an agency field:

  1. Identify the entity and table where the agency field is to be added.

  2. For the new agency field, define the field attributes (such as field name, type of field, field length, and whether the field is required).

  3. On the database server, update the database table with the new agency field.

  4. On the application server, create a text file that includes the parameters in the table below, separated by commas, and save it in the Agency Fields folder.
     

Parameter

Description

ModelName

The entity to which the new field is being added. This name is case sensitive.

Name

The name of the field.

StoredName

The name of the field in the database. This name is case sensitive.

Type

The type of field. You can use one of these values:

  • String(length), where length is the length of the string in the database

  • DateTime

  • Boolean

  • Long (this is equivalent to Long integer)

  • Numeric(scale.precision), where scale and precision match the database scale and precision

Nullable

Add this parameter if the field allows Nulls in the database. String types do not require this parameter; other data types may.

For example, if you are adding a required text field with a length of 20 characters named STRING_FIELD_1 to the Project entity, you might type the following line in the file:

ModelName=Project,Name=MyStringField,StoredName=STRING_FIELD_1,Type=String(2)

 

  1. On the application server, make a backup copy of the following set of existing files and place it in a separate location.

    Repository.dll
    Repository.ModelMappings.dll
    Repository.Models.dll
    Repository.SchemaFiles.dll


    The files are located in the following directories in your installation folder:
    \ModelsHost\bin
    \ProcessesAndUtils
    \Processeshost\bin
    \WCFHost\bin
    \ReportHost\bin


    Note: The files are the same in all five locations. Only one set needs to be backed up.
  2. On the application server, make a backup copy of the existing ModelServiceReference.dll file in the ReportHost\bin folder in your installation folder.  Place the backup copy in a separate location.

  3. On the web server, make a backup copy of the existing ModelServiceReference.dll file in the UIHost\bin folder in your installation folder. Place the backup copy in a separate location.

  4. In the Command Prompt window, change the directory to the location of the AgencyFields folder in your installation directory and run the AFGenerator.exe program by typing the following text at the command prompt:

    AFGenerator.exe (text file created in step 4 above)

    Note:  The Microsoft .NET Framework 4 SDK must be installed prior to running the AFGenerator.

    If successful, the system displays a message to confirm that the following files were created successfully:
    Repository.dll
    Repository.ModelMappings.dll
    Repository.Models.dll
    Repository.SchemaFiles.dll
    ModelServiceReference.dll

  5. You must stop the DateTriggerService before copying the new files.  To locate this service, navigate to the Administrative Tools > Services. Find the service beginning with DateTriggerService and followed by the name of the application website. This is the service you must stop. For example, if your application website name is AWProject, then stop the service named DateTriggerService_AWProject.

    It is also recommended that you stop the application and UI websites. To do this, right-click the application and UI websites in IIS Manager, and choose Stop.

    Note: After you finish copying and pasting the files, you must restart the appropriate services.

  6. Copy the first four files created (Repository.dll, Repository.ModelMappings.dll, Repository.Models.dll, Repository.SchemaFiles.dll) from:

    \inetpub\wwwroot\<instance>\AgencyFields\AFGenerator\DLLs

    To the following locations in your installation folder (overwriting the existing files):
    \ModelsHost\bin
    \ProcessesAndUtils
    \ProcessesHost\bin
    \ReportHost\bin
    \WCFHost\bin

  7. Copy the ModelServiceReference.dll file created in Step 8 to the following locations on the application server (overwriting the existing files):
    \ProcessesAndUtils
    \ReportHost\bin
    \UIHost\bin

  8. After replacing the files, restart the application and UI websites via IIS Manager and restart the DateTriggerService.

  9. To automatically set up the attributes of the new agency field, you must generate the business metadata for your system.  To do this, open the Command Prompt window, change the directory to the ProcessesAndUtils directory in your installation folder, and run the following command:

    GenerateInitialBusinessMetadata -All

  10. After generating the business metadata, you can modify the label, location, and default values for the new agency field on the Business Metadata Summary component. For more information, see Editing the Business Metadata.

  11. You can customize other aspects of the field, such as where it is located on a component, on the Component Overview. For more information, see Customizing Components.

Related topics:

Setting Custom Field Default Values

Customizing Field Labels and Locations

Generating the Business Metadata after Updates

Blue bar indicating the end of the topic