{ "header": { "version": 1, "type": "record" }, "body": { "record1": { "<1>": "declare function start_window, relational_call, security_check, msg, key_sort\r\ndeclare function rowexists, det_table_suff\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 * REMARKED BELOW DUE TO SRL REMOVAL\r\n *TableSuff = det_table_suff()\r\n *if TableSuff then\r\n\t WindowToCall = 'ORDER'\r\n\t Table = 'ORDER'\r\n\t RightsToCheck = 'Order'\r\n\t SymKeys = 'OPEN_ORDER_KEYS'\r\n\t PopupToCall = 'SHOW_ORDERS'\r\n\t *if TableSuff <> 'M&S' then\r\n\t * WindowToCall :='_':TableSuff\r\n\t * RightsToCheck := ' SRL'\r\n\t * Table := '_':TableSuff\r\n\t * SymKeys = 'SRL_':SymKeys\r\n\t * PopupToCall = 'SHOW':'_':TableSuff:'_ORDERS'\r\n\t *end\r\n\t\tif security_check( RightsToCheck, Read$ ) then\r\n\t\t CoNo = .co_no->text\r\n\t\t if CoNo then\r\n\t\t if rowexists( 'COMPANY', CoNo ) then\r\n\t\t\t\t\tKeys = relational_call( 'COMPANY', SymKeys, CoNo, PopupToCall, Table, '#ENTRY_DATE' )\r\n\t\t\t\t\tif Keys then\r\n\t\t\t\t\t swap 'NoKeys' with '' in Keys\r\n\t\t\t\t\t ParamToPass = Keys\r\n\t \t\t\t\tVoid = start_window( WindowToCall, '', ParamToPass:'*CENTER', '', '' )\r\n\t \t\t end\r\n\t\t\t end else\r\n\t\t\t MsgInfo = ''\r\n\t\t\t MsgInfo = 'You must save this company first.'\r\n\t\t\t MsgInfo = '!'\r\n\t\t\t Void = msg( '', MsgInfo )\r\n\t\t\t end\r\n\t end else\r\n\t\t MsgRec = ''\r\n\t\t MsgRec = 'You must retrieve a company first...' \r\n\t\t MsgRec = '!'\r\n\t\t Void = msg( '', MsgRec ) \r\n\t\t end\r\n\t\tend else\r\n\t\t security_err_msg( RightsToCheck, Read$ )\r\n\t\tend\r\n *end\r\nend else\r\n MsgInfo = ''\r\n MsgInfo = 'A company cannot order unless they are defined as a customer...'\r\n MsgInfo = '!'\r\n Void = msg( '', MsgInfo )\r\nend\r\n\r\nRETURN 0" } } }