Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Ignore invalid entries in 'SendTo' field

Posted on 2003-03-31
11
Medium Priority
?
252 Views
Last Modified: 2013-12-18
I have a form with a button which runs a formula.
The formula uses the MailForward command to send the form to an address group.

I am not responsible for maintaining the address group, and it contains several invalid names. This means that when someone runs the MailForward code, they are prompted several times with the invalid names, asking them whether they want to change/skip the name or cancel sending the mail.

How can I get the code to ignore any invalid names and just send the mail anyway?
Is there  a parameter I can use when calling MailForward, or am I stuck with this annoying dialog?

0
Comment
Question by:mrt1
  • 5
  • 3
9 Comments
 
LVL 4

Expert Comment

by:hshevitz
ID: 8238388
Try using this formula in your button to validate the users in the group and use the "ValidatedSendTo" to use in your MailForward function. This will compare the names in your group with active names from the $Users view in the Domino Directory and replace the invalid names with a null and trim out blank values.

m_server:=@Subset( @DbName; 1 );
m_path:="Names.nsf";
LOOKUP_VIEW := "($VIMGroups)";
LOOKUP_VIEW2 := "($Users)";
KEY := "<YOUR GROUP NAME GOES HERE>";
ERR_MSG := "";

LOOKUP := @LowerCase(@DbLookup( "Notes":"NoCache"; m_server:m_path; LOOKUP_VIEW; KEY; 3 ));
USERS := @LowerCase(@DbColumn("Notes":"NoCache"; m_server:m_path; LOOKUP_VIEW2; 1));
NEWLIST := LOOKUP;
NEWLIST2 := NEWLIST2;

@If(
     @IsError(LOOKUP);
          ERR_MSG;
     @Do(
          @Set("NEWLIST"; @Replace(NEWLIST ; USERS; ""));
          @Set("NEWLIST2"; @Replace(LOOKUP; NEWLIST; ""))
     )
);
ValidatedSendTo := @Trim(NEWLIST2)

This worked for me, hope it will work for you.

HS
0
 
LVL 4

Expert Comment

by:hshevitz
ID: 8238444
You could also use this in a computed field with the last line changed to @Trim(NEWLIST2)
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 8243237
Try adding the domain name after the group name.  For example, if the group is named WIDESCALE DISTRIBUTION and your Notes domain is GENERAL_MOTORS, try sending the message to WIDESCALE DISTRIBUTION@GENERAL MOTORS instead of just WIDESCALE DISTRIBUTION.

The downside is that there will be a delivery failure for each invalid address.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 31

Expert Comment

by:qwaletee
ID: 8243244
P.S. The answer provided by hshevitz will not work.  Here's what the code there basically does...

Assign the variable named LOOKUP to contain the multiple members of the group.

Assign the variableUSERS to contain the results of looking up the user name (looking up their own names).

Poblem is, for the  users that don't exist, there is nothing to look up.  If there is even one bad user name, NOtes will treat the entore results as bad user names. It does NOT return just the user names that have matches, as the solution code assumes.

Further, it would not cover nested groups (where the main group has other group names as members).
0
 
LVL 4

Expert Comment

by:hshevitz
ID: 8245284
I don't think you looked at this code very well. What it does is:

1) LOOKUP contains the members of the group
2) USERS is the lookup to the $Users view in the Domino Directory
3) NEWLIST is assigned the same value as LOOKUP
4) NEWLIST then uses @Replace to extract the names of the group that ARE NOT in the Domino Directory
5) NEWLIST2 then uses @Replace to replace the names that contained in LOOKUP that appear in NEWLIST with ""
6) This then leaves only the valid names in NEWLIST2
7) @Trim is used to get rid of the null values.

You are correct though about using this with nested groups, although I didn't see any mention of them in the original request.

HS
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 8321138
Gotcha, replace would work -- for a small organization.  Get a few thousand groups, you break the 64k barrier on the DbColumn.  When I quickly glanced through yur code, I though you were doing a DbLookup of the names to see which returned values and which did not, and I was wrong about that.

So, you have a good solution -- for small Notes shops that do not use nested groups.  If that applies to mrt1, then you should get points.
0
 
LVL 2

Author Comment

by:mrt1
ID: 8325328
Afraid I need this work to work for a large company with many nested groups. Thatnks for the input so far, though...
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 800 total points
ID: 8329979
I'll repeat my previous advice:

Try adding the domain name after the group name.  For example, if the group is named WIDESCALE DISTRIBUTION and your Notes domain is GENERAL_MOTORS, try sending the message to WIDESCALE DISTRIBUTION@GENERAL MOTORS instead of just WIDESCALE DISTRIBUTION.

The downside is that there will be a delivery failure for each invalid address.

For the dlievery failures, I just thought of some things you can do.

1) If $AssistMail is set, I don't know if the router bothers with dleivery failures

2) You can set a ReplyTo address to be a dummy mailbox
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 8329985
Of course, if you use a dummy replyTo, then if anyone legitimately replies, it will go to the same place.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question