11 lines
2.8 KiB
JSON
11 lines
2.8 KiB
JSON
{
|
|
"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, scroll_enable\r\n$insert logical\r\n$insert security_rights_equ\r\n\r\nNewRecord = false$\r\nif rowexists( 'COMPANY', .co_no->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( 'Company', Write$ ) then\r\n ReadOk = true$ \r\n end else\r\n security_err_msg( 'Company', Write$ )\t \r\n\t ReadOk = false$\r\n\t .co_no->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 end\r\n if rowexists( 'COMPANY', .co_no->text ) then\r\n if .co_type->value = 'O' THEN\r\n .co_type->enabled = 1 \r\n end else\r\n .co_type->enabled = 0\r\n end\r\n end else\r\n .co_type->enabled = 1\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 .entry_id->enabled = 0\r\n .entry_date->enabled = 0\r\n Void = company_comm( 'SET_FIELDS' )\r\n if NewRecord else\r\n\t if security_check( 'Company', Edit$ ) else\r\n\t * protect all fields\r\n\t AllControls = utility( 'OBJECTLIST', @window, '' )\r\n\t Acnt = fieldcount( AllControls, @fm ) \r\n\t for i = 1 to Acnt \r\n\t ThisControl = AllControls<i>\r\n\t if ThisControl[-6,6] = '_LABEL' or index( ThisControl, 'MENU', 1 ) or index( ThisControl, 'TEXT', 1 ) else\r\n\t void = set_property( ThisControl, 'ENABLED', 0 )\r\n\t end \r\n\t next i \r\n\t Void = set_property( @window:'.CONTACT_NAMES', 'ENABLED', 1 )\r\n\t Void = set_property( @window:'.QUOTE_BUTTON', 'ENABLED', 1 ) \r\n\t Void = set_property( @window:'.AC_BUTTON', 'ENABLED', 1 )\r\n\t Void = set_property( @window:'.WI_BUTTON', 'ENABLED', 1 )\r\n\t Void = set_property( @window:'.ORDER_BUTTON', 'ENABLED', 1 )\r\n\t Void = set_property( @window:'.INVOICE_BUTTON', 'ENABLED', 1 )\r\n\t Void = set_property( @window:'.CALL_VISIT_BUTTON', 'ENABLED', 1 )\r\n\t Void = set_property( @window:'.PROD_SPEC_BUTTON', 'ENABLED', 1 )\r\n\t Void = scroll_enable()\t\t \r\n\t end\r\n end\r\nend\r\nreturn 0"
|
|
}
|
|
}
|
|
} |