Solved

Listtag error in Forall

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

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.

Question has a verified solution.

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

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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.

831 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