English 中文(简体)
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?

问题回答

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.

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.

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.

Use Environment variable - Set name through Formula Environment variable and use the script to access the environment variable and execute your code.





相关问题
Where are the javadocs for Lotus Notes.jar?

I need to use Lotus Notes/Domino as a data source from a Java application. The documentation at IBM says that the Notes.jar contains everything I will need, but where are the javadocs?

Is Interop.Domino dll thread safe?

I am using Interop.Domino dll version 1.2 in c# application, and using multithreading to access multiple NSF file at same time by creating new session for each thread created (Max 5 threads at a time)....

C#和Lotus Notes附录一

我正在使用C#,并需要附上一张空白(shortcut/link)档案和电子邮件给一个彩票账户。 问题是一对一幅通用形象的不实之词,没有像......那样显示双fold。

How to maintain Lotus Notes Version ? C#

I made one product which is retrieving attachment from mails and saving it on particular folder. But problem i am facing is it is not working in 8.0 version. I did development on Lotus Notes 8.5 ...

How to Edit NSF file using c#?

I want to programaticaly change some values to NSF item and then want to save it.(i.e to edit NSF File and then save the editions) for example: I want to set Sender name of all mails to "preeti@abc....

热门标签