Professional > Interview scripting > Sample management > Sample management functions > GetSampleRec
 
GetSampleRec
Use this function to select a sample record from a queue for outbound calling.
Syntax
Function GetSampleRec(SampleFields, SampleRec)
Parts
SampleFields
Input parameter of type SampleFields.
SampleRec
Output parameter of type SampleRec.
Example
The function in this example searches for a sample record in three stages. It starts by checking for a previously called record whose appointment time is due. If a suitable record is found, the function returns this record and sets GetSampleRec to SUCCESS.
If there are no sample records whose appointments are due, the function searches for a previously called record whose recall time is due. Records with recall times are typically those that gave a no-answer or busy signal the last time they were called. If a suitable record is found, the function returns this record and sets GetSampleRec to SUCCESS.
If there are no suitable records whose recall time is due, the function selects the first record from the FRESH queue. (This queue usually holds records that have not yet been called.) If the FRESH queue is empty, there are no records available for calling at this point and GetSampleRec is set to NO_RECORDS.
Function GetSampleRec(SampleFields, SampleRec)
  Set SampleRec = HandleAppointments(LogStart,       NumSampleRecsInBatch)
  If Not (SampleRec Is Nothing) Then
    UseThisSampleRecForCATI LogStart, SampleRec
    GetSampleRec = SUCCESS
     Exit Function
  End If

  Set SampleRec = HandleRecalls(LogStart, NumSampleRecsInBatch)
  If Not (SampleRec Is Nothing) Then
    UseThisSampleRecForCATI LogStart, SampleRec
    GetSampleRec = SUCCESS
    Exit Function
  End If

  Set SampleRec = GetFirstRecord(LogStart, "FRESH",       NumSampleRecsInBatch)
  If Not (SampleRec Is Nothing) Then
    UseThisSampleRecForCATI LogStart, SampleRec
    GetSampleRec = SUCCESS
    Exit Function
  End If

  GetSampleRec = NO_RECORDS
End Function
See also
Sample management functions