Remove spaces and parenthesises from Fax No.

I want to use the Customers Fax No. in our faxing solution (Faxmaker 12). To send a fax, the format should be ‘’. My problem is that the Fax No. in Navision looks like this: +31 (0)314 999 999. Since spaces and parenthesises are not allowed in a SMTP Address, I want to take these out of the number before sending them to Faxmaker. Anyone any idea how to do this?

Use DELCHR Command. Example String := DELCHR(“fax No.”,’=’,’+’);

Thank you very much. You have set me on the right trail!

I do the same thing basically with this code: xNo := DELCHR(xNo,’=’,’-’); xNo := DELCHR(xNo,’=’,’ ‘); xNo := DELCHR(xNo,’=’,’(’); xNo := DELCHR(xNo,’=’,’)’); With Faxmaker for Exchange, using MAPI, you can include these extra standard characters without any problems.

Not when using Exchange 5.5, unfortunately. You can only have one SMTP connector, and therefore I cannot route faxes sent with the [FAX:] command to the fax server. If I would route al outbound mail to the fax server, the normal SMTP-mails would be included. In Exchange 2003 however, you can create a separate SMTP connector just for Faxmaker. So, the only solution I have is to use the command. And thanks to this forum I can easily transfer the number without spaces and other characters to faxmaker!

Another option is just to strip all non-numeric characters out with a function. Something like: Function NumericOnly::Code(inPhoneNo::Code); Numbers := ''; FOR Index := 1 TO STRLEN(inPhoneNo) DO BEGIN CharValue := inPhoneNo[Index]; IF (CharValue >= '0') AND (CharValue <= '9') THEN Numbers := Numbers + FORMAT(CharValue); END; EXIT(Numbers) I guess it depends on how consistant people are in typing in the fax numbers.

I think its pretty tough to get people to be concistant, so Chris’ solution is generally the safest.

I fully agree with you, David (and Chris). In this case, however, I just leave it with the first solution. Perhaps I will follow a course in programming some day. The described function is a bit to much for me, being just a humble end user. Untill then, I’m afraid I’ll have to use the easier way [8D]

Michiel, copy Chris’ code, and use it, you can’t really damage much, and its the best way to learn.

Hi, you can use a litle shorter code:NumericOnly(piText : Text[30]) : Text[30] EXIT(DELCHR(piText,'=',DELCHR(piText,'=','0123456789'))); br Josef Metz

Hi Josef, That’s quite clever - thx [:D]

OK David, I want to give it a try. I create a function ‘NumericOnly’ in a report. Then I add a parameter ‘piText’ of datatype Text, length 30. My DataItem looks like ‘NumericOnly(piText : Text[30])’ and I can add the code: EXIT(DELCHR(piText,’=’,DELCHR(piText,’=’,‘0123456789’))); Two questions: 1. My DataItem doesn’t look like the one Josef describes: NumericOnly(piText : Text[30]) : Text[30] 2. If the function is correct, how should I call it to translate the Fax No.?

Hi, You can call the function in ONAftergetRecord of report , dataitem Faxno.:=NumericOnly(Customer.“Fax No.”);

Thanks Rajesh, thats’ perfectly clear. However, I get stuck on creating the function itself. How should I build up the function? I use ‘View-C/AL Globals-Functions’, add a function ‘NumericOnly’ and then click button ‘Locals’, and add parameter piText. Then I add the code in the newly created section, but receive an error about Arrays when compiling. I’m afraid I’m missing something [:I]

Hi, You have to set the Returnvalue to Text30 as well (No name)

Works great! Wish I’d become a developer [:D] Thank you all!

Michiel, So your faxno is now 31104567890 or 32104567890 this seems ok but don’t you have problems sending faxes to foreign countries. Faxmaker recognizes foreign numbers by the character + and adds 00 before. So +32104567890 becomes 0032104567890

Hoi Erik, You’re correct, but I changed the code to: EXIT(DELCHR(piText,'=',DELCHR(piText,'=','+0123456789'))); So I only added the +, and the result for +31 (0)314 399 399 will be: +310314399399 But thanks for the thinking!

See Michaiel so now you are a programmer [8D]