Files
open-insight/LSL2/OIEVENT/OPTIONS/QUOTE_OLD.FAX.json
2024-03-25 15:12:53 -07:00

11 lines
2.0 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "$insert company_equ\r\n$insert names_equ\r\n$insert msg_equates\r\n$insert popup_equates\r\ndeclare function fieldcount, msg, entid, repository\r\n\r\nCustomerRec = xlate( 'COMPANY', .cust_no->text, '', 'X' )\r\nNameRec = xlate( 'NAMES', .name_no->text, '', 'X' )\r\n\r\n* get the fax numbers for this customer\r\nCustPhones = CustomerRec<company_phones$>\r\nCustPhoneTypes = CustomerRec<company_phone_types$>\r\nCpCnt = fieldcount( CustPhones, @vm )\r\nExpInfo = ''\r\nfor i = 1 to CpCnt\r\n ThisPhoneType = CustPhoneTypes<1,i>\r\n ThisPhoneNum = CustPhones<1,i>\r\n convert @lower.case to @upper.case in ThisPhoneType\r\n if ThisPhoneType = 'FAX' then\r\n ExpInfo := oconv( .cust_no->text, '[XLATE_CONV,COMPANY*CO_NAME]' ):@svm:ThisPhoneNum:@vm\r\n end\r\nnext i\r\n\r\n* now get all fax numbers for this contact name\r\nNamePhones = NameRec<names_phone$>\r\nNamePhoneTypes = NameRec<names_phone_types$>\r\nNpCnt = fieldcount( NamePhones, @vm )\r\nfor i = 1 to NpCnt\r\n ThisPhoneType = NamePhoneTypes<1,i>\r\n ThisPhoneNum = NamePhones<1,i>\r\n convert @lower.case to @upper.case in ThisPhoneType\r\n if ThisPhoneType = 'FAX' then\r\n ExpInfo := oconv( .name_no->text, '[XLATE_CONV,NAMES*FIRST_LAST]' ):@svm:ThisPhoneNum:@vm\r\n end\r\nnext i\r\nif ExpInfo then\r\n ExpInfo[-1,1] = ''\r\n PopId = entid( @appid<1>, 'POPUP', '', 'FAX_NUMBERS' )\r\n OverRide = ''\r\n OverRide<pdisplay$> = ExpInfo\r\n Tresp = repository( 'EXECUTE', PopId, @window, OverRide )\r\n if Tresp <> '' then\r\n .fax->text = Tresp\r\n end\r\nend else\r\n MsgText = ''\r\n MsgText<mtext$> = 'There are no fax numbers defined for ':oconv( .cust_no->text, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n MsgText<mtext$> = MsgText<mtext$>:' or for ':oconv( .name_no->text, '[XLATE_CONV,NAMES*FIRST_LAST]' ):'.'\r\n MsgText<micon$> = '!'\r\n Void = msg( '', MsgText )\r\nend\r\nRETURN 0"
}
}
}