ChooseRecord Function

This function is called during assembly when the end user clicks the Select button on a Regular or Repeated Series dialog. The implementation of this entry point should display (or cause to be displayed) a modal dialog box where the user can browse, search, filter, or otherwise review information made available by the answer source application. When the user chooses a single record containing the data, the implementation should close the modal dialog box and return a 32-bit integer identifier that HotDocs will use later (in calls to GetField or GetFieldW) to fetch the associated data.

On Spreadsheet dialogs, the ChooseMultipleRecords function is called instead of ChooseRecord.

Syntax

long ChooseRecord ( )

Return Value

This function should return the 32-bit record number if a record was selected by the user. If a record was not selected, or if the user cancels the record selection, it should return zero (0).

HotDocs assumes that all record IDs returned by an answer source are greater than or equal to zero. That is, negative record IDs are not allowed.

Example (Visual C++)

The following Visual C++ example displays a MessageBox where the user can choose to either select record #129 or not.

long WINAPI ChooseRecord()

{

  long nResult = MessageBox(NULL, "Do you want to select record #129?", "ChooseRecord", MB_YESNO);

  if (nResult == IDYES)

    return 129;

  else

    return 0;

}