{ "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\r\nICustPhoneTypes = CustomerRec\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\r\nINamePhoneTypes = NameRec\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 = 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 = 'There are no international fax numbers defined for ':oconv( .cust_no->text, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n MsgText = MsgText:' or for ':oconv( .name_no->text, '[XLATE_CONV,NAMES*FIRST_LAST]' ):'.'\r\n MsgText = '!'\r\n Void = msg( '', MsgText )\r\nend\r\n\r\nRETURN 0" } } }