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

11 lines
2.1 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\nICustPhones = CustomerRec<company_intl_phones$>\r\nICustPhoneTypes = CustomerRec<company_intl_phone_types$>\r\nCpCnt = fieldcount( ICustPhones, @vm )\r\nExpInfo = ''\r\nfor i = 1 to CpCnt\r\n ThisPhoneType = ICustPhoneTypes<1,i>\r\n ThisPhoneNum = ICustPhones<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\nINamePhones = NameRec<names_intl_phone$>\r\nINamePhoneTypes = NameRec<names_intl_phone_types$>\r\nNpCnt = fieldcount( INamePhones, @vm )\r\nfor i = 1 to NpCnt\r\n ThisPhoneType = INamePhoneTypes<1,i>\r\n ThisPhoneNum = INamePhones<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', '', 'INTL_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 .intl_fax->text = Tresp\r\n end\r\nend else\r\n MsgText = ''\r\n MsgText<mtext$> = 'There are no international 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\n\r\nRETURN 0"
}
}
}