Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

Multipe fields and email

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
Rajen
Asked:
Rajen
  • 8
  • 6
1 Solution
 
HemanthaKumarCommented:
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
 
RajenAuthor Commented:
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
 
RajenAuthor Commented:
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

 
RajenAuthor Commented:
I meant to say total combination is 300
0
 
HemanthaKumarCommented:
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
 
RajenAuthor Commented:
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
 
qwaleteeCommented:
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
 
HemanthaKumarCommented:
You have to do a permuted addtition

FIELD1 *+ Field2 *+ Field3

0
 
RajenAuthor Commented:
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
 
HemanthaKumarCommented:
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
 
RajenAuthor Commented:
I got it to work, but I am getting a lot of combinations, how will lookup handle this as a key
Raj
0
 
HemanthaKumarCommented:
What lookup ? DBLookup ?? It cannot that is the intent of providing LS code above
0
 
RajenAuthor Commented:
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
 
HemanthaKumarCommented:
Usually I suggest to validate fields during save instead of refresh... as it cut down the advantage of refresh !
0
 
RajenAuthor Commented:
Hemant,
Thanks for all your help.

Raj
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 8
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now