Solved

Listtag error in Forall

Posted on 2004-08-19
3
310 Views
Last Modified: 2013-12-18
I get the "LISTTAG argument not a list element" error in the following Forall. doc.fldEmplReqs is a multivalue checkbox that dos populate the variable "newEmplItems" successfully. I need to extract each value into the varible "apr".

Function newEmplApproval(doc As NotesDocument) As Variant
      Dim newEmplItems  As Variant
      Dim newEmplkey As String
      Dim apr As String
      Dim aprname As String
      Dim BS As String, LS As String, DLTS As String, SS As String
      Dim num As String
      newEmplItems = doc.fldEmplReqs
      
      Forall x In newEmplItems
            apr =  Listtag(x)
            If apr  <> "" Then
                  num= assignNumber(doc)
                  aprname = getProfile(apr)
                  SS = "Action Required:  Ticket # " & num
                  BS = "A ticket has been opened that requires your approval." & Chr(10) & Chr(10) & "All relevant information is included in the request."
                  Call sendMail(BS,LS,DLTS,SS,aprname,doc)      
            End If
            
      End Forall      
      
End Function
0
Comment
Question by:bobdraz
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 500 total points
ID: 11841779
wrong use of listtag...

Use array to store values

eg:
k=0
   Forall x In newEmplItems
redim preserve apr(k) as string
          If x <> "" Then
               apr(k) = x
               k = k + 1
               num= assignNumber(doc)
               aprname = getProfile(x)
               SS = "Action Required:  Ticket # " & num
               BS = "A ticket has been opened that requires your approval." & Chr(10) & Chr(10) & "All relevant information is included in the request."
               Call sendMail(BS,LS,DLTS,SS,aprname,doc)    
          End If
         
     End Forall    

~Hemanth
0
 

Author Comment

by:bobdraz
ID: 11841950
My changed code follows, but now I get the error "Not a sub or function:APR"
Function newEmplApproval(doc As NotesDocument) As Variant
      Dim newEmplItems  As Variant
      Dim newEmplkey As String
      Dim apr As String
      Dim aprname As String
      Dim BS As String, LS As String, DLTS As String, SS As String
      Dim num As String
      Dim k As Integer
      newEmplItems = doc.fldEmplReqs
      k=0
      Forall x In newEmplItems
            Redim Preserve apr(k) As String
            If x <> "" Then
                  apr(k) = x
                  k = k + 1
                  aprname = getProfile(x)
                  num= assignNumber(doc)
                  SS = "Action Required:  Ticket # " & num
                  BS = "A ticket has been opened that requires your approval." & Chr(10) & Chr(10) & "All relevant information is included in the request."
                  Call sendMail(BS,LS,DLTS,SS,aprname,doc)      
            End If
            
      End Forall      
      
End Function
0
 

Author Comment

by:bobdraz
ID: 11842586
I resolved the error "Not a sub or function:APR". Your code worked fine. Thank you very much. Your time and efforts are appriciated.

Bob
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

8 Experts available now in Live!

Get 1:1 Help Now