This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 31, 2013, 7:16 PM
453 Posts
topic has been resolvedResolved

Calling a function in a JS Library from LS

  • Category: Other
  • Platform: Windows
  • Release: 9.0
  • Role: Developer
  • Tags: lotusscript,javascript
  • Replies: 5

(I posted this in the 8.5 form as well)

I have a JS function that I use on an XPage that uses:


var forms:Array = database.getForms()


I then cycle through the forms and select them into an array if the form has a specific field. Works great.
Problem is that I have a scheduled LS Agent that runs on schedule that needs to do the same thing. However, LS has a database.getForm("FormName") but no database.getForms().
So if I could call the JS function from the LS agent I'd be a happy camper but I don't think that is possible.
Another option would be to create a view of forms that contain the specified field, but I don't know how to do that either.
Any Help
Thanks

Nov 1, 2013, 6:55 AM
5 Posts
Lotusscript version

Here is a function from Data Moving Animal:

Function getForms( dbTarget As NotesDatabase ) As Variant
'Returns the list of Forms in the db
 
Dim varForms As Variant
Dim arrayForms() As String
Dim i As Integer, intElements As Integer
 
varForms = dbTarget.Forms
 
If Isarray( varForms ) Then
intElements = Ubound( varForms )
Redim arrayForms( intElements )
 
i=0
Forall form In varForms
arrayForms(i)=form.Name
i = i+1
End Forall
 
 
Else
Redim arrayForms(0)
End If
 
getForms = arrayForms
 
End Function

 

So looks like you should try database.Forms, not database.getForms() if you are using LS.

Nov 1, 2013, 6:55 AM
54 Posts
database forms

I´m guessing that there is a getForms in Java there will be a database.forms in LS ;-)

Nov 1, 2013, 6:43 PM
3 Posts
What you are looking for is the Forms property of NotesDatabase
Go to designer help and search the page about

Forms (NotesDatabase - LotusScript=AE)

As LotusScript doesn't have the gett= er and setter convention, that Java (and hence Javascript) are using, you access the property directly and not through a getter function
Nov 1, 2013, 10:21 PM
453 Posts
Thanks, my eyes were not working & my brain.

That works fine Thanks

Brain cramp!


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal