{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare function next_key, send_event, msg, security_check\r\ndeclare subroutine security_err_msg, delete_row\r\n$insert security_rights_equ\r\n$insert quote_equ\r\n\r\nif security_check( 'Quote', Write$ ) then\r\n    * save off all data\r\n    AllControls = utility( 'OBJECTLIST', @window, '' )\r\n    convert @fm to @rm in AllControls\r\n    AllData = get_property( Allcontrols, 'TEXT' )\r\n    QuoteDetail = .quote_detail->array\r\n    RecToUse = ''\r\n    RecToUse<quote_setup_charge$> = iconv( QuoteDetail<4>, 'MD2,$' )\r\n    RecToUse<quote_srp_charge$>   = iconv( QuoteDetail<5>, 'MD2,$' )\r\n    RecToUse<quote_quantity$>     = QuoteDetail<2>\r\n    RecToUse<quote_price$>        = iconv( QuoteDetail<6>, 'MD2,$' )\r\n    OrigQuoteNo = .quote_no->text\r\n\tChoice = send_event( @window, 'CLEAR' )\r\n\tif Choice = '' then\r\n\t    * if choice has a value then the user has canceled \r\n\t\topen 'QUOTE' to QuoteTableVar else\r\n\t\t    Void = msg( '', 'Unable to open QUOTE...' )\r\n\t\t    return 0\r\n\t\tend\r\n\t\tNextQuoteKey = next_key( 'QUOTE', QuoteTableVar, 'NEXT', '' )\r\n\t\t.quote_no->text = NextQuoteKey\r\n\t\tunlock QuoteTableVar, NextQuoteKey else\r\n\t\t    Void = msg( '', 'Unable to unlock QUOTE ':NextQuoteKey )\r\n\t\t    return 0\r\n\t\tend\r\n\t\tVoid = send_event( @window:'.QUOTE_NO', 'LOSTFOCUS' )\r\n\t\tVoid = set_property( AllControls, 'TEXT', AllData )\r\n\t\t.quote_no->text = NextQuoteKey\r\n    \t.signatures->array = @vm:@vm:@vm:@fm:@vm:@vm:@vm\r\n\t\t.entry_date->text = oconv( date(), 'D2/' )\r\n\t\t.entry_id->text   = oconv( @user4, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )\r\n\t\t.status->value    = 'U'\r\n\t\t.inquiry_status->value = 'O'\r\n\t\tVoid = set_property( @window, 'RECORD', RecToUse )\r\n\t\tQuoteDetail<7> = @vm\r\n\t\t.quote_detail->array = QuoteDetail\r\n\t\tVoid = send_event( @window:'.QUOTE_DETAIL', 'CALCULATE', 7 )\r\n\t\t@@window->savewarn = 1\r\n\t\t*delete_row( 'QUOTE', NextQuoteKey, '' ) ;* the user may not want to save\r\n\t\t* OI WILL NOW ONLY WRITE WHAT HAS CHANGED SINCE THE READ\r\n    end\r\nend else\r\n    security_err_msg( 'Quote', Write$ )\r\nend\r\nRETURN 0"
        }
    }
}