11 lines
4.1 KiB
JSON
11 lines
4.1 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, scroll_enable\r\ndeclare function fieldcount, send_event\r\n$insert logical\r\n$insert security_rights_equ\r\n$insert quote_sigs_equ\r\n\r\nNewRecord = false$\r\nif rowexists( 'CAR', .car_ref_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( 'CAR', Write$ ) then\r\n ReadOk = true$ \r\n end else\r\n security_err_msg( 'CAR', Write$ )\t \r\n\t ReadOk = false$\r\n\t .car_ref_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 end\r\n CarRefId = .car_ref_id->text\r\n ProtectVar = 'ENTRY_ID/ENTRY_DATE/CUST_NAME/DIVISION/STATUS/'\r\n ProtectVar:= 'RESP_USER_NAME/RESP_SIGNATURE/RESP_SIGNATURE_NAME/CAR_INPLACE_SIGNATURE/'\r\n ProtectVar:= 'CAR_INPLACE_SIGNATURE_NAME/VIP_MFG_SIGNATURE/VIP_MFG_SIGNATURE_NAME/'\r\n ProtectVar:= 'CAR_VERIFIED_SIGNATURE/CAR_VERIFIED_SIGNATURE_NAME/CUST_REV/CUST_SPEC/'\r\n ProtectVar:= 'CONTACT_NAME/CAR_INPLACE_DATE/RMA_SPECIAL_INST/RMA_ENG_COMMENTS/RMA_INFO1/'\r\n ProtectVar:= 'RMA_INFO2/ACCT_REP'\r\n swap '/' with @rm:@window:'.' in ProtectVar\r\n ProtectVar = @window:'.':ProtectVar\r\n Void = set_property( ProtectVar, 'ENABLED', 0 )\r\n Void = set_property( @window, '@OrigEstLossValue', .est_loss_value->text )\r\n *Void = set_property( @window, '@OrigServRep', .accountreps->text )\r\n if ( .rma_info2->array<1,1> <> '' ) then\r\n * there is rma info in the CAR so change button to Edit RMA Info...\r\n .rma_button->text = 'Edit RMA Info...'\r\n end else\r\n .rma_button->text = 'Define RMA Info...' \r\n end\r\n if NewRecord then\r\n .entry_id->text = oconv( @user4, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )\r\n .entry_date->text = oconv( date(), 'D2/' ) \r\n .confirm_status->value = '' \r\n end else\r\n Void = set_property( @window, '@OrigRespUserID', .resp_user_id->text ) \r\n if .ant_car_inplace_date->text <> '' then\r\n * there is an inplace date protect unless it is the vp of manufacturing\r\n SignatureInfo = xlate( 'CONFIG', 'QUOTE_SIGS', '', 'X' )\r\n\t VipMfg = SignatureInfo<VipMfg$>\r\n if @user4 = VipMfg else\r\n .ant_car_inplace_date->enabled = false$ \r\n end\r\n end else\r\n .ant_car_inplace_date->enabled = true$\r\n end\r\n end \r\n if .resp_user_id->text <> '' and ( oconv( @user4, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' ) <> .entry_id->text ) then\r\n * if there is a responsible user defined and this is not the person who entered it then\r\n * protect the responsible person, so someone cannot change\r\n .resp_user_id->enabled = 0\r\n end \r\n if .status->value = 'V' then\r\n * it is verified do not let them change the confirm or unconfirm status\r\n .confirm_status->enabled = false$\r\n end else\r\n .confirm_status->enabled = true$\r\n end\r\n if NewRecord else\r\n\t if security_check( 'CAR', 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 = scroll_enable()\t\t \r\n\t end\r\n end\r\nend\r\nRETURN 0"
|
|
}
|
|
}
|
|
} |