lotus-noteslotus-dominolotusscriptlotuslotus-formula

Lotus Notes convert formula to agent


how do I convert my formula into an agent? I wrote a days left formula in a view and want to make it an agent.

Formula:

FIELD DaysLeft := @If(ExpDate = ""; ""; @Integer((ExpDate - @Today)/60/60/24))

I have plenty of columns in a view so it will be like:

FIELD DaysLeft1 := @If(ExpDate1 = ""; ""; @Integer((ExpDate1 - @Today)/60/60/24))
FIELD DaysLeft2 := @If(ExpDate2 = ""; ""; @Integer((ExpDate2 - @Today)/60/60/24))
FIELD DaysLeft3 := @If(ExpDate3 = ""; ""; @Integer((ExpDate3 - @Today)/60/60/24))

Left the Option default:

Declarations:

 Dim session As NotesSession
 Dim db As NotesDatabase
 Dim view As NotesView

Initialize:

Sub Initialize
Dim doc As NotesDocument
Set session = New NotesSession
Set db = session.currentdatabase

FIELD DaysLeft := @If(ExpDate = ""; ""; @Integer((ExpDate - @Today)/60/60/24))

End Sub

What should be the code these objects?

enter image description here

enter image description here


Solution

  • Create an agent of type "Formula":

    enter image description here

    You can add your formula there. You created a LotusScript agent instead.

    enter image description here