If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Creating a Dupe Check Class

The following steps provide an overview of how to write a duplicate check object for Aptify:

If using the template provided by Aptify for this project, configure the template as described in Loading the Sample Code and Templates, rename the project and class as necessary, and skip to Step 9

 

  1. Open a new Class Library project in Visual Studio.
  2. Configure the Properties for the project.
    • When assigning an assembly name for this object, use this format: [EntityName]DupeCheck (remove spaces in the entity name). For example: VehicleModelsDupeCheck (or SampleVehicleModelsDupeCheck, as shown below).
    • Specify a root namespace for your project. For example: Aptify.SampleApplication.MotorLoaner, as shown below.

      Dupe Check Object Properties
  3. Click the References tab in the Properties page and add a reference to the following Aptify objects:
    • AptifyApplication
    • AptifyAttributeManagement
    • AptifyExceptionManagement
    • AptifyGenericDataServices
    • AptifyGenericEntityBase
    • IAptifyDataServices

      References to the following Microsoft Objects should already exist in the project: System, System.Data, and System.Xml. You can find the Aptify objects in your Aptify Windows application's C:\Program Files\Aptify 5.5 directory.

  4. Open the class file.
  5. Add Option Explicit On and Option Strict On at the top of the class file (as described in Use Option Explicit and Option Strict.
  6. Import the following namespaces into the class:
    • Aptify.Framework.BusinessLogic.GenericEntity
    • Aptify.Framework.DataServices
    • Aptify.Framework.Application
       
  7. Define the name for your class (typically this is Public Class [Object Name]).
  8. Add Implements IAptifyDuplicateCheck below the class name to specify that this class will implement that interface to create a duplicate check object.

    Dupe CheckObject Code
  9. Write a function to implement the CheckForDuplicate method for your object.
  10. If you are planning to use the standard Duplicate Check dialog box, configure the DuplicateMessageObject Property to Return Nothing.
    • See the sample applicable source code for examples.
  11. Build, test, and sign the assembly. See Best Practices When Writing Code for Aptify for details.

Related topics

Copyright © 2014-2017 Aptify - Confidential and Proprietary