3 arrays trick question challenge

I have 3 multi value fields, requestor(R), implementer(I) and tester(T).

What is the best way to work out the following:

If R=I=T, R=I, R=T, I=T, R<>I<>T?

Array 1 say contains Person A, A, A

Array 2 say contains Person A, B:A, C:D:E

Array 3 say contains Person B, B:C, D:F:G

The whole idea is to work the criteria so that if the Requestor is Person A and is also the implementor and Test Person, only 1 mail gets send to the requester…then so on in the second array.

It’s gets complicated? But, might be easily for the lotus gurus…

Subject: 3 arrays trick question challenge

Evaluate statement in combination with @IsMember?

Subject: 3 arrays trick question challenge

use @unique it solve your problem

Subject: RE: 3 arrays trick question challenge

Your data structures are not clearly defined, and your question is also vague. Do you have the sample data:

Array1: A, A, A

Array2: A, B:A, C:D:E

Array3: B, B:C, D:F:G

in one Notes document? In how many fields? Is “B:A” a multivalue item read from one field, or a string containing two names delimited by a colon?

Do you mean to do a certain amount of processing and then send one email to each person including all the notices that are specific to them? So that in processing all the above data, A would get just one email, B would get one, every letter would get just one?

Or do you mean to send one email to A about “Array1”, another email to A about “Array2”, one to B about Array2 and one about Array3, and so on?

Do you mean to send to all the people at once, or wait until the document reaches a particular state, e.g. in step 1 just send to A about array1 and array2, and B about array3, then in step 2 send email to A about array1 and array2, to B about array2 and array3, and to C about array3?

Is the body of the email supposed to be the same in each case, or does it matter whether you’re sending to someone just as a requester, versus as requester and implementer, vs. implementor only?

Perhaps it will help you to use a list of NotesDocuments with the recipient as key:

Dim emailList List As NotesDocument

where each list element is a NotesDocument which is the memo you are going to send. Now when you want to notify someone, you can check whether you already have started a memo to them. If not, create a new memo and put it in the list. In either case, add the notification text, doclink, whatever, to the memo. When all done, use Forall to iterate thru the list and send the memos.

Subject: RE: 3 arrays trick question challenge

it is just one notes document with 3 fields, requestor, implementer and tester. Assuming that the requester is Person A, which exists in 3 arrays/fields, so just send one email instead of 3. I, myself is confusion ie why I ask for help on what is the best solution.

If the status is open for example, the requestor needs to notify all implementer and tester.

If the status is implemented, then the tester has to know about it.

The whole idea is to work out who to notify from the arrays based on the STATUS.

Subject: RE: 3 arrays trick question challenge

I think you have to establish the requirements yourself – we don’t know your application well enough to tell you what it should do.

So you have three multivalued fields in one document. Here again is your example data from before, which I still don’t understand:

Array1: A, A, A

Array2: A, B:A, C:D:E

Array3: B, B:C, D:F:G

Array1 contains the requester. Why does array1 list A three times? Does one document represent one task? Did A request this task three times, and that’s why it lists them three times? You said it is one document, but I think we are actually seeing data from three documents here, one for each array. Is that right?

So task 1 was requested by A, will be implemented by A, and tested by A. Task 2 was requested by A, will be implemented by A and B, and tested by C, D and E. And so on. Is that right?

It is confusing to talk about three documents at once. It’s also confusing to talk about arrays when what you actually have are three separate fields, Requester, Implementer, Tester. Let’s just choose one example:

Requester: A

Implementer: A, B

Tester: C, D, E

If Status = “open” you want to notify all implementers and testers of the new request.

If Status = “implemented”, you want to notify all testers.

You don’t say under what circumstances you want to send the notification or what language you want to work in. I will assume you like macro language and that you want to send the notification when the status changes and the document is saved. However, please note – there is no event that lets you detect whether a field has a different value from when you started editing. You have to remember the field value somewhere else so that you can determine whether it has changed. So I will assume you have a computed when composed field named OldStatus with formula “”. Then here is your agent code (run on new and modified documents) to send out the notifications, perhaps.

@If(OldStatus = Status; @Return(“status not changed”); “”);

FIELD OldStatus

recipients := @Unique(@If(Status = “open”; Implementer : Tester; Status = “implemented”; Implementer; @Return(“don’t notify anybody”)));

@MailSend(recipients; “”; “”; “Please look at this here document”; "Its status is " + Status; “”; [Includedoclink])

Subject: RE: 3 arrays trick question challenge

thanks for your great comments. I think the word is Unique…that might be the answer. Currently, I am working in lotus script. The thing is if the requester=implementor=testperson, i only want to send one email as it is to the same person. Then, I have to look at other combinations as there are multiple implementors and test persons. Probably unique is the way to go…

Subject: RE: 3 arrays trick question challenge

Look at the ArrayUnique function in Designer Help.