?
Solved

Ignore invalid entries in 'SendTo' field

Posted on 2003-03-31
11
Medium Priority
?
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
11 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

777 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