[Last Call] Learn how to a build a cloud-first strategyRegister Now

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

Picklist Not working correctly - Please look

When this code is in place - It is suppose to send a email to all the users selected in the Picklist.

I am Jaziar and I am picking the action Forward

eg: select John Doe
               Chuck Roast

The code does not send them a email

eg: If I select John Doe
              Jaziar

I get a email and John Doe Does not

eg: I just select Jaziar

I get the email

Here is part of the action code that is doing that

Set newDoc = New NotesDocument(db)
Call thisDoc.CopyAllItems(newDoc, True)
      
 varNewTo = ws.PickListStrings(PICKLIST_NAMES, True)
  k = Inputbox("Enter your comments")    
  newDoc.SendTo= varNewTo
'newDoc.SenderList = "Forwarded by " & session.CommonUserName & Chr$(13) & newDoc.SenderList(0)
  newDoc.Subject = "Fw: " & thisDoc.Subject(0)    
  newDoc.FowardComments = k    
  Call newDoc.Send(True, newDoc.SendTo)

But I have discovered that if I remove the Picklist and assign newDoc.SendTo to thisDoc.SendTo

Set newDoc = New NotesDocument(db)
      Call thisDoc.CopyAllItems(newDoc, True)
      
      'varNewTo = ws.PickListStrings(PICKLIST_NAMES, True)
      k = Inputbox("Enter your comments")    
      'newDoc.SendTo= varNewTo
      newDoc.SendTo = thisDoc.SendTo      
'newDoc.SenderList = "Forwarded by " & session.CommonUserName & Chr$(13) & newDoc.SenderList(0)
      newDoc.Subject = "Fw: " & thisDoc.Subject(0)    
      newDoc.FowardComments = k    
      Call newDoc.Send(True, newDoc.SendTo)

It will send emails to everyone in the SendTo field from the orig document.  Meaning it will send multiple people documents from the script.

Why is it that the using the picklist only sends emails if the person clicking the action is in the picklist selection.

This is so very important to get fix as soon as possible.  If you have ideas please respond promptly




0
Jaziar
Asked:
Jaziar
  • 9
  • 3
1 Solution
 
JaziarAuthor Commented:
Is that the document is a newDoc and a copy of thisDoc it wont work?

PICKLIST_NAMES (0)      Displays the names dialog box. Can only be used in the first form of the method.??
0
 
JaziarAuthor Commented:
I moved this up
varNewTo = ws.PickListStrings(PICKLIST_NAMES, True)

Set newDoc = New NotesDocument(db)
varNewTo = ws.PickListStrings(PICKLIST_NAMES, True)
Call thisDoc.CopyAllItems(newDoc, True)
 
  k = Inputbox("Enter your comments")    
  newDoc.SendTo= varNewTo
'newDoc.SenderList = "Forwarded by " & session.CommonUserName & Chr$(13) & newDoc.SenderList(0)
  newDoc.Subject = "Fw: " & thisDoc.Subject(0)    
  newDoc.FowardComments = k    
  Call newDoc.Send(True, newDoc.SendTo)

It sent the emails like it should but no form with it.
0
 
JaziarAuthor Commented:
What could be getting copied over

Call thisDoc.CopyAllItems(newDoc, True)

That is breaking the picklist?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Sjef BosmanGroupware ConsultantCommented:
Hi Jaziar, the story continues (http:Q_21395643.html).

Can you create a fixed array instead of the thisDoc.SendTo assignment, just to test if anything new is accepted? Like this

    Dim st(1) As String
    st(0)= "Jaziar/ACME"
    st(1)= "John Doe/ACME"
    newDoc.SendTo= st

etc.?

And additionally, just after the PickList, do this:
    Messagebox "Picklist returned " & (Ubound(varNewTo)+1) & " names"
0
 
JaziarAuthor Commented:
Doing it now
0
 
JaziarAuthor Commented:
Dim st(1) As String
    st(0)= "Jaziar/ACME"
    st(1)= "John Doe/ACME"
    newDoc.SendTo= st

This once again only sent a email to Jaziar and not John

Messagebox "Picklist returned " & (Ubound(varNewTo)+1) & " names"

Said returned 2 names

I mean I move the Picklist above the copy and it sends the emails correctly, put it back and it breaks
 Can only be used in the first form of the method.?? can this be the problem?
0
 
Sjef BosmanGroupware ConsultantCommented:
> This once again only sent a email to Jaziar and not John

So if you don't use the Picklist at all, it still doesn't work. Beats me why...

Did you already try the last suggestion in the other question, about using the current document?
0
 
JaziarAuthor Commented:
Using the current document?  I am not sure, we have tried so many things.  what is strange is moving the picklist up above the copy and it works fine.  The copy has to be getting a value that is overridding the sendTO
0
 
Sjef BosmanGroupware ConsultantCommented:
I suggested to save the current code somewhere, and use the code I wrote. It uses the current document, which doesn't matter because it isn't saved anywhere.
0
 
JaziarAuthor Commented:
Same Problem - OK I dont think this is for whatever reason is going to work - can you think of a another way to send a email to the users in the picklist?
0
 
JaziarAuthor Commented:
I just found a document in my inbow that has been forwarded by other people.  I hit forward and it worked.  Is there a way to find out what code is behind that action button?  I knew it used to work.
0
 
JaziarAuthor Commented:
I was completly off on this one.  The problem is with a ReadersField on the first form.  There is a readers field on the first form that is set to [Everybody].  When the email is sent it adds the SendTo users to the DocReaders + [everybody]
so the 2 form with the forward action (problem above) is only showing to form to the people added the DocReaders.  I think when forward is clicked it needs to add the users from the picklist to the readers field as well
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 9
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now