Solved

Listtag error in Forall

Posted on 2004-08-19
3
311 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

867 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

12 Experts available now in Live!

Get 1:1 Help Now