Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multipe fields and email

Posted on 2004-03-24
15
Medium Priority
?
205 Views
Last Modified: 2013-12-18
Hi,
I have a situation where the I have a form which has 3 check box fields. THe first field has 3 options and the second has 10 and the third has 5.

Ex let field #1 has values I,B and C
and field #2 has CS,IS,PS,ZS,XS,TCP,TS,TSN,TO,TCP
Field #3 has LP,DL,E,EL,PE

Now i have a set of users who own a combination of the values as mentioned in the above 3 fields

I would like to send an email based on the selection. Since it is a multivlue field sometimes the combination could meet 2 users and hence have to send an email to both of them.

How do I check for the combination before emailing.


Thanks
Raj
0
Comment
Question by:Rajen
[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
  • 8
  • 6
15 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10670943
Here is something you should be able to do..

Create a lookup document with the name of the person who owns the categories.

Create a view with combined /concatenated values of all 3 fields .

Then in the form concatenate the field values and then do a lookup on the view above which will return the names of the person matching the category and send mail to these persons

~Hemanth
0
 

Author Comment

by:Rajen
ID: 10671397
Hemant,
I have the follwoing 4 users and based on the field value I have provided the combination comes around 300. How can I check for this. Hope I am not missing something here.

Raj
0
 

Author Comment

by:Rajen
ID: 10671414
Hemant,
I have 4 users and based on the field value I have provided above, the combination each user owns comes around 300. How can I check for this.

Raj
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Rajen
ID: 10671433
I meant to say total combination is 300
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10671470
You have to design the lookup form with following fields

Name.. User Name field
Field1.. Multivalued field
Field2.. Multivalued field
Field3.. Multivalued field

Now for the user say Rajen..Enable

field #1 = I and B
field #2 = CS,IS,PS,ZS,XS,TCP,TS,TSN,TO,TCP
Field #3 = LP,DL

SO when you build the view with Field1 + Field2 + Field3 you will get all possible combinations. This should be in your I column and also enabel col property "Show multi values as seperate entries"

0
 

Author Comment

by:Rajen
ID: 10671793
It only combines in such a way ,showing seperate entry for the different first field values in the column formula. Say if I have 5 values in field one it shows only 5 combination and neglectng the multiple values in feild 2 and 3
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10671805
Or, might be simpler to reverse it.  Have a document that describes who the owner is for field1, value I
A doc for owners of field1, values S

etc.

0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10672224
You have to do a permuted addtition

FIELD1 *+ Field2 *+ Field3

0
 

Author Comment

by:Rajen
ID: 10678405
Hemant, I have the view and all the lookup done. For some reason my form where the user selects the check box does not return all value, but only the first from each field. Do I have to set up any properties. I have the filed as Checkbox with Multi value automatically selected and also used permuted addition while passing it to the lookup.
Raj
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10678643
uhm.. that is true it will return the first key value out of the list.. So there is little more work to do.

You have to adopt the script and use Recalc event to fetch the values

Create one more field effectively using the same permuted addition as indicated above to list all possible key to lookup. And in the script scan thru each key value and use getalldocumentsbykey to get the value of the recepients

1. Create field AllKeys .. computed,
FIELD1 *+ Field2 *+ Field3

2. The script in the recalc event

dim s as new notessession
dim db as NotesDatabase
dim doc as notesdocument, note as notesdocument
dim view as notesView
dim col as NotesDocumentCollection
dim temp(0) as String

set note = source.Document
set db = s.currentdatabase
set view = db.GetVIew( "VIEWWITHALLPOSSIBLEKEYS")
recipients = temp
forall k in note.AllKeys
set col = view.GetAllDocumentsByKey( k, true)
set doc = col.GetFirstDocument
while not doc is nothing
recipients = fulltrim(arrayappend(recipients, doc.Name))      ' The recipent name field .. replace it whatever you have it in the lookup doc
set doc = col.GetNextDocument(doc)
wend
End Forall
' Now set the recipients in the field
note.Recipients = recipients


This is a prototype and could be fine tuned later to your need
0
 

Author Comment

by:Rajen
ID: 10678836
I got it to work, but I am getting a lot of combinations, how will lookup handle this as a key
Raj
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10679093
What lookup ? DBLookup ?? It cannot that is the intent of providing LS code above
0
 

Author Comment

by:Rajen
ID: 10679640
Hemant,
The previous post was before I could see your recent comment since I did not refersh the page and had it opened since yesterday. Pls ignore it and everything seems to work great. The only problem I see is if I have it on the recalc event, it refreshes everytime when user goes to a field to select since I have some validation formula.

Raj
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 400 total points
ID: 10679797
Usually I suggest to validate fields during save instead of refresh... as it cut down the advantage of refresh !
0
 

Author Comment

by:Rajen
ID: 10680346
Hemant,
Thanks for all your help.

Raj
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 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