{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare subroutine btree.extract, update_index, rlist, end_dialog\r\ndeclare function msg, key_sort, utility, ex_vm_rem\r\n$insert msg_equates\r\n$insert lsl_users_equ\r\n\r\nopen 'DICT.SRP_COC_RESULTS' to DictSRPCOCResultsTable else\r\n   Void = msg( '', 'Unable to open DICT.SRP_COC_RESULTS...' )\r\n   return 0\r\nend\r\nSearchStr = ''\r\nReactors       = .reactors->array<1>\r\nCustIds        = .customer_info->array<1>\r\nSRPDateFrom    = .srp_date_from->text\r\nSRPDateThru    = .srp_date_thru->text\r\nReactors = ex_vm_rem( Reactors )\r\nCustIds  = ex_vm_rem( CustIds )\r\n*\r\nif Reactors then\r\n    SearchStr<-1> = 'REACTOR':@vm:Reactors\r\nend\r\nif CustIds then\r\n    SearchStr<-1> = 'CUST_ID':@vm:CustIds\r\nend\r\nif SRPDateFrom and SRPDateThru then\r\n    SearchStr<-1> = 'SRP_DATE':@vm:SRPDateFrom:'...':SRPDateThru\r\nend else\r\n\tif SRPDateFrom then\r\n\t    SearchStr<-1> = 'SRP_DATE':@vm:'>=':SRPDateFrom\r\n\tend\r\n\tif SRPDateThru then\r\n\t    SearchStr<-1> = 'SRP_DATE':@vm:'<=':SRPDateThru\r\n\tend\r\nend\r\nif SearchStr then\r\n    SearchStr := @fm\r\n    Void = utility( 'CURSOR', 'H' )\r\n    * do a btree.extract\r\n    btree.extract( SearchStr, 'SRP_COC_RESULTS', DictSRPCOCResultsTable, Keys, '', Flag )\r\n    if Flag <> 0 then\r\n       Void = msg( '', 'Error while extracting SRP_COC_RESULTS records...' )\r\n       return 0\r\n    end\r\n    if Keys then\r\n       convert @vm to @fm in Keys\r\n       Keys = key_sort( Keys, 'SRP_COC_RESULTS', '#SRP_DATE':@fm:'CUST_NAME':@fm:'REACTOR', 0 )\r\n       end_dialog( @window, Keys )\r\n    end else\r\n       MsgInfo = ''\r\n       MsgInfo<mtext$> = 'No records found meeting your criteria...' \r\n       MsgInfo<micon$> = '!'\r\n       Void = msg( '', MsgInfo )\r\n    end\r\n    Void = utility( 'CURSOR', 'A' )\r\nend else\r\n    MsgInfo = ''\r\n    MsgInfo<mtext$> = 'You have not entered any search criteria...' \r\n    MsgInfo<micon$> = '!'\r\n    Void = msg( '', MsgInfo )\r\nend\r\nreturn 0\r\n\r\n"
        }
    }
}