{
    "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 lsl_users_equ\r\n$insert msg_equates\r\n\r\nopen 'DICT.WO_LOG' to DictWOLogTable else\r\n   Void = msg( '', 'Unable to open DICT.WO_LOG...' )\r\n   return 0\r\nend\r\nSearchStr = ''\r\nCustIds       = ex_vm_rem(.customer_info->array<1>)\r\nif CustIds then\r\n    SearchStr<-1> = 'CUST_NO':@vm:CustIds\r\nend\r\nPSNs = ex_vm_rem( .psns->array )\r\nif PSNs then\r\n    SearchStr<-1> = 'PROD_SPEC_ID':@vm:PSNs\r\nend\r\nEntryDateFrom = .entry_date_from->text\r\nEntryDateThru = .entry_date_thru->text\r\nif EntryDateFrom and EntryDateThru then\r\n    SearchStr<-1> = 'ENTRY_DATE':@vm:EntryDateFrom:'...':EntryDateThru\r\nend else\r\n\tif EntryDateFrom then\r\n\t   SearchStr<-1> = 'ENTRY_DATE':@vm:'>=':EntryDateFrom\r\n\tend\r\n\tif EntryDateThru then\r\n\t   SearchStr<-1> = 'ENTRY_DATE':@vm:'<=':EntryDateThru\r\n\tend\r\nend\r\nWoFrom = .wo_from->text\r\nWoThru = .wo_thru->text\r\nif WoFrom and WoThru then\r\n    SearchStr<-1> = 'WO':@vm:WoFrom:'...':WoThru\r\nend else\r\n\tif WoFrom then\r\n\t   SearchStr<-1> = 'WO':@vm:'>=':WoFrom\r\n\tend\r\n\tif WoThru then\r\n\t   SearchStr<-1> = 'WO':@vm:'<=':WoThru\r\n\tend\r\nend\r\nOpen          = .open_check->check\r\nClosed        = .closed_check->check\r\nStatusVar = ''\r\nif Open then\r\n    StatusVar<1,-1> = 'O'\r\nend\r\nif Closed then\r\n    StatusVar<1,-1> = 'C'\r\nend\r\nif StatusVar then\r\n   SearchStr<-1> = 'STATUS':@vm:StatusVar\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, 'WO_LOG', DictWOLogTable, Keys, '', Flag )\r\n    if Flag <> 0 then\r\n       Void = msg( '', 'Error while extracting WO_LOG 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, 'WO_LOG', 'CUST_NAME':@fm:'#ENTRY_DATE', 1 )\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"
        }
    }
}