{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare subroutine forward_event, security_err_msg\r\ndeclare function company_comm, msg, security_check, post_event, rowexists\r\ndeclare function fieldcount, send_event, memberof, prod_spec_comm, scroll_enable\r\n$insert logical\r\n$insert security_rights_equ\r\n\r\n\r\nNewRecord = false$\r\nif rowexists( 'PROD_SPEC', .prod_spec_id->text ) then\r\n   ReadOk = true$\r\nend else\r\n   * user is trying to add new do they have write rights\r\n   if security_check( 'Prod Spec', Write$ ) then\r\n      ReadOk = true$  \r\n   end else\r\n      security_err_msg( 'Prod Spec', Write$ )\t  \r\n\t  ReadOk = false$\r\n\t  .prod_spec_id->text = ''\r\n\t  Void = post_event( CtrlEntId, 'CLEAR', False$, True$ )\r\n   end\r\n   NewRecord = true$\r\nend\r\nif ReadOk then\r\n   if get_property( @window, '@NoRead' ) then\r\n       Void = set_property( @window, '@NoRead', 0 )\r\n   end else\r\n       * no qbf active do the read\r\n       * if it is active the read already took place\r\n       forward_event()\r\n\r\n       \r\n   end\r\n   \r\n   ProdSpecID = .prod_spec_id->text\r\n   ProtectVar = 'ENTRY_ID/ENTRY_DATE/CUST_NAME/DIVISION/CTO_SIGNATURE/CTO_SIGNATURE_NAME'\r\n   swap '/' with @rm:@window:'.' in ProtectVar\r\n   ProtectVar = @window:'.':ProtectVar\r\n   Void = set_property( ProtectVar, 'ENABLED', 0 )\r\n   if rowexists( 'PROD_SPEC', ProdSpecID ) else\r\n      .entry_id->text = oconv( @user4, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )\r\n      .entry_date->text = oconv( date(), 'D2/' )   \r\n   end         \r\n   *\r\n   TMod = .mod_info->array\r\n   InMod = Tmod<1>\r\n   TMod<2> = oconv( InMod, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )\r\n   .mod_info->array = TMod\r\n  \r\n   if memberof( @user4, 'SALES' ) or memberof( @user4, 'MASTER' ) then\r\n      .scan_button->visible = 1   \r\n   end else\r\n      .scan_button->visible = 0\r\n   end\r\n   *\r\n   if NewRecord then\r\n       .rtype->value = ''\r\n   end else\r\n\t   if security_check( 'Prod Spec', Edit$ ) else\r\n\t      * protect all fields\r\n\t      AllControls = utility( 'OBJECTLIST', @window, '' )\r\n\t      \r\n\t      \r\n\t      .spec_button_fix->enabled = 1\r\n\t      .view_quotes_fix->enabled = 1\r\n          Void = scroll_enable()\t      \r\n\t   end\r\n   end\r\n   Void = prod_spec_comm('SET_SCANNED_IMAGE')   \r\nend\r\nRETURN 0"
        }
    }
}