Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling Lotus Script Function From Lotus Formula

I need to call a lotus script function from Lotus Formula.

The function returns a result. I do not just want to run a script which does not return any value.

This is for Lotus Notes 7.

Example

LotusScript Functions:

Function isName( name As String) as Boolean  
     if name Is "Danny" Then  
        isName = true  
     endif  
     isName = false  
 End function  

LotusFormula

name := getName("troy")???????

therefore I can then use the name in lotus formula.

Is this possible?

like image 911
Andrew Avatar asked Dec 10 '10 04:12

Andrew


3 Answers

No. The best you can do from Formula Language is to call a LotusScript agent using either the ToolsRunMacro or RunAgent @Commands, exchanging values through document fields or environment variables.

like image 64
Stan Rogers Avatar answered Oct 23 '22 07:10

Stan Rogers


There is no way to call and return a value in LotusScript from the formula language. However, you can go the other way with the LotusScript Evaluate method. Perhaps you can redesign your logic to be based in LotusScript primarily.

like image 1
Ken Pespisa Avatar answered Oct 23 '22 06:10

Ken Pespisa


You can run formula from within LotusScript, but not the other way around, unless you use an agent as Stan has eluded to.

After a few weary years of dev, I generally consider writing lotusScript for most of my work, the exceptions are only if I can write the formula in less than 10 lines and it's unlikely to interact with other documents or update them.

As soon as you need to interrogate many fields in other documents or update them, write them in script. The particular function you have listed in your question would also work as formula, but if your desire is to modularise it in script, then you should consider using script, in those situations exclusively, in place of formula. I would say Formula is merely a short cut for doing basic operations.

like image 1
angryITguy Avatar answered Oct 23 '22 08:10

angryITguy