Solved

Multipe fields and email

Posted on 2004-03-24
15
196 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
  • 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
 

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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 100 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now