Solved

Listtag error in Forall

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Fax server not receiving SMTP from Lotus Notes 6 384
Lotus notes email code 13 100
Lotus Domino server 11 69
Migrating from Lotus Notes to Office 365 2 157
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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