Sample management functions
You control the behavior of Sample Management by using the following functions in scripts:
AddSampleRec
Use to create new sample records and place them in the appropriate queue.
AuthenticateSampleRec
Called by UNICOM Intelligence Interviewer - Server whenever the authentication page is posted during inbound calling. Use to check whether a respondent is valid.
GetSampleRec
Called by UNICOM Intelligence Interviewer - Server to select a sample record from a queue for use in an outbound interview.
ReturnSampleRec
Called by UNICOM Intelligence Interviewer - Server whenever an interview is ended.
RemoveSampleRec
Use to remove sample records from a queue or from the sample table.
UtcNow
Returns the current time in UTC format.
Using the functions
For all of these functions:
▪All of the parameters are of the Object type.
▪The return values are the predefined constants SUCCESS, FAILURE, and PARAM_ERROR. These return values must be set in the function.
The AuthenticateSampleRec function also has a REJECT return value that can be used when a respondent fails authentication and you do not want to display the retry-authentication page; for example, because the respondent already has a record in the COMPLETED queue or because the respondent failed quota control.
The GetSampleRec function also has a NO_RECORDS return value that is set when the ScanQueue function returns no records.
These functions should start with On Error Resume Next if there is a risk that the script might cause a Component Object Model (COM) error. For example, when there is no mapped Serial sample record field, the following statement causes a COM error:
Set myVar=SampleRec.Fields("Serial")
Starting the function with On Error Resume Next stops the function failing when this occurs.
See also