open-insight/LSL2/OIEVENT/READ/PROD_SPEC..json
2024-03-25 15:12:53 -07:00

11 lines
4.0 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare subroutine forward_event, security_err_msg, unlock, start_window, set_property, post_event\r\ndeclare subroutine DBW_PROD_SPEC_GAN_EVENTS, 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\t\r\n\tPSNo = Get_Property(@Window:'.PROD_SPEC_ID', 'TEXT')\r\n\tReactType = Xlate('PROD_SPEC', PSNo, 'REACTOR_TYPE', 'X')\r\n\tIf ReactType EQ 'GAN' then\r\n\t\t*locktype = ''\r\n\t\t*Unlock('PROD_SPEC', PSNo, '', locktype)\r\n\t\tParentWindow = Get_Property(@Window, \"PARENT\")\r\n\t\tStart_Window('DBW_PROD_SPEC_GAN', ParentWindow, PSNo)\r\n\t\t* determine which control has focus\r\n *GotFocus_Control = Get_Property(@window,\"GOTFOCUS_CONTROL\")\r\n \r\n * force the matching of the GOTFOCUS and DEFPROP properties on the control which has focus\r\n *Set_Property( GotFocus_Control, \"FOCUS\", 1)\r\n \r\n * Turn the SAVEWARN message off\r\n *Set_Property(@window,\"SAVEWARN\",0)\r\n\t\t*Post_Event(@Window, 'CLOSE')\t\t\t\t\r\n\tend else\r\n\r\n\r\n\tNewRecord = false$\r\n\tif rowexists( 'PROD_SPEC', PSNo ) then\r\n\t ReadOk = true$\r\n\tend else\r\n\r\n // Block user from reserving their own key out of sequence.\r\n ErrorMsg = 'PROD_SPEC ':PSNo:' does not exist! You must use the \"Create New PSN\" button in order to create a '\r\n ErrorMsg := 'brand new PROD_SPEC record.'\r\n Msg(@Window, '', 'OK', '', 'Error':@FM:ErrorMsg)\r\n .prod_spec_id->text = ''\r\n ReadOK = False$\r\n\t\tVoid = post_event( CtrlEntId, 'CLEAR', False$, True$ )\r\n\t\t\r\n\t\t// Deprecated code - DJS - 3/8/2022\t\r\n\t\t// Some of this logic has been moved to the PUB_CREATE_NEW_PSN.CLICK() event within PROD_SPEC_EVENTS\r\n\t * user is trying to add new do they have write rights\r\n\t *if security_check( 'Prod Spec', Write$ ) then\r\n\t *ReadOk = true$ \r\n\t *end else\r\n\t *security_err_msg( 'Prod Spec', Write$ )\t \r\n\t\t *ReadOk = false$\r\n\t\t *.prod_spec_id->text = ''\r\n\t\t *Void = post_event( CtrlEntId, 'CLEAR', False$, True$ )\r\n\t *end\r\n\t *NewRecord = true$\r\n\tend\r\n\r\n\r\n\r\n\tif ReadOk then\r\n\t if get_property( @window, '@NoRead' ) then\r\n\t Void = set_property( @window, '@NoRead', 0 )\r\n\t end else\r\n\t * no qbf active do the read\r\n\t * if it is active the read already took place\r\n\t forward_event()\r\n\r\n\t \r\n\t end\r\n\t \r\n\t ProdSpecID = .prod_spec_id->text\r\n\t ProtectVar = 'ENTRY_ID/ENTRY_DATE/CUST_NAME/DIVISION/CTO_SIGNATURE/CTO_SIGNATURE_NAME'\r\n\t swap '/' with @rm:@window:'.' in ProtectVar\r\n\t ProtectVar = @window:'.':ProtectVar\r\n\t Void = set_property( ProtectVar, 'ENABLED', 0 )\r\n\t if rowexists( 'PROD_SPEC', ProdSpecID ) else\r\n\t .entry_id->text = oconv( @user4, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )\r\n\t .entry_date->text = oconv( date(), 'D2/' ) \r\n\t end \r\n\t *\r\n\t TMod = .mod_info->array\r\n\t InMod = Tmod<1>\r\n\t TMod<2> = oconv( InMod, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )\r\n\t .mod_info->array = TMod\r\n\t \r\n\t if memberof( @user4, 'SALES' ) or memberof( @user4, 'MASTER' ) then\r\n\t .scan_button->visible = 1 \r\n\t end else\r\n\t .scan_button->visible = 0\r\n\t end\r\n\t *\r\n\t if NewRecord then\r\n\t .rtype->value = ''\r\n\t end else\r\n\t\t if security_check( 'Prod Spec', Edit$ ) else\r\n\t\t * protect all fields\r\n\t\t AllControls = utility( 'OBJECTLIST', @window, '' )\r\n\t\t \r\n\t\t \r\n\t\t .spec_button_fix->enabled = 1\r\n\t\t .view_quotes_fix->enabled = 1\r\n\t Void = scroll_enable()\t \r\n\t\t end\r\n\t end\r\n\t Void = prod_spec_comm('SET_SCANNED_IMAGE') \r\n\tend\r\n\r\n\r\nRETURN 0"
}
}
}