open-insight/LSL2/OIEVENT/CLICK/COMPANY.WI_BUTTON.json
2024-03-25 15:12:53 -07:00

11 lines
1.5 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare function start_window, relational_call, security_check, msg, key_sort\r\ndeclare function rowexists\r\ndeclare subroutine security_err_msg\r\n$insert msg_equates\r\n$insert security_rights_equ\r\n\r\nif .co_type->value = 'C' then\r\n\tif security_check( 'Wafer Inventory', Read$ ) then\r\n\t CoNo = .co_no->text\r\n\t if CoNo then\r\n\t if rowexists( 'COMPANY', CoNo ) then\r\n\t\t\t\tKeys = relational_call( 'COMPANY', 'WAF_INV_KEYS', CoNo, 'SHOW_WAF_INV', 'WAFER_INV', '#ENTRY_DATE' )\r\n\t\t\t\tif Keys then\r\n\t\t\t\t swap 'NoKeys' with '' in Keys\r\n\t\t\t\t ParamToPass = Keys\r\n \t\t\t\tVoid = start_window( 'WAFER_INV', '', ParamToPass:'*CENTER', '', '' )\r\n \t\t end\r\n\t\t end else\r\n\t\t MsgInfo = ''\r\n\t\t MsgInfo<mtext$> = 'You must save this company first.'\r\n\t\t MsgInfo<micon$> = '!'\r\n\t\t Void = msg( '', MsgInfo )\r\n\t\t end\r\n\t end else\r\n\t MsgRec = ''\r\n\t MsgRec<mtext$> = 'You must retrieve a company first...' \r\n\t MsgRec<micon$> = '!'\r\n\t Void = msg( '', MsgRec ) \r\n\t end\r\n\tend else\r\n\t security_err_msg( 'Wafer Inventory', Read$ )\r\n\tend\r\nend else\r\n MsgInfo = ''\r\n MsgInfo<mtext$> = 'You cannot setup wafer inventory for a company unless they are defined as a customer...'\r\n MsgInfo<micon$> = '!'\r\n Void = msg( '', MsgInfo )\r\nend\r\nRETURN 0"
}
}
}