OpenNTF.org - Choose fax numbers OR mail add
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Choose fax numbers OR mail addresses 
Rating:
Not Rated Yet 
Contributor:
Gernot Hummer 
Category:
Lotus Formula 
Type:
Email 
Notes Version:
R6.x 
Last Modified:
08 Jun 2004 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
Usually if you want to send a fax via your email-database Notes just returns the mailadress if you choose an address. Add a second button with this code behind it to get faxnumbers out of all available directories, even private ones. _FAXEXTENSION is the extension that has to be added to route the mail to the fax gateway. Here we go:


REM {Script for adding faxabality to mail templates.};

REM {Constants};
_FAXEXTENSION := "@CHARON";
_ERRORTITLE := "Error";
_GROUPERROR := "You have chosen at least on group or server. It is not permitted to choose groups or servers.";
_NUMBERERROR := "No number found for ";

REM {Choose persons for SendTo.};
_PERSON := @LowerCase(@Name([CN]; @Sort( @PickList( [Name]))));

REM {Connecting faxnumbers with proper persons.};
_FAX := @NameLookup( [Exhaustive]; _PERSON; "OfficeFAXPhoneNumber" );
_RESULTMULT := @Elements( _FAX )/@Elements( _PERSON );
_ALLPERSONS := @Trim( @Explode( @Repeat( _PERSON + "|"; _RESULTMULT ); "|" ));
@If(
@Elements( _ALLPERSONS ) != @Elements( _FAX );
@Do(
@Prompt([Ok]; _ERRORTITLE ; _GROUPERROR );
@Return("")
);
""
);
_ALLFAX := _ALLPERSONS + "@" + _FAX + _FAXEXTENSION;

REM {Clean out persons without faxnumbers.};
_FAXCLEAN := @Trim( @Left( @ReplaceSubstring( _ALLFAX; "@" + _FAXEXTENSION; "~" ); _FAXEXTENSION ));

REM {Prompt persons without a number.};
_NONUMBER := @Trim( @Replace( _PERSON; @Left( _FAXCLEAN; "@" ); "" ) );
@If(
_NONUMBER != "";
@Prompt( [OK]; _ERRORTITLE; _NUMBERERROR +
@Implode( _NONUMBER; ", " ) + "." );
""
);

REM {Insert faxnumbers into field SendTo.};
@If(
_FAXCLEAN != "";
@Do(
@SetField("EnterSendTo"; @Unique( _FAXCLEAN + _FAXEXTENSION ) );
@SetField("SendTo"; @Unique( _FAXCLEAN + _FAXEXTENSION ) )
);
""
)

Usage / Example
Additional info: You can make this code run on R5-servers if you just edit the "@sort" function out. Everything else should run fine on R5.
 Comments

No documents found

 Add your comment!