got this message on the log:Unsupported trigger and search in the background or embedded agent
This is is in the WEBQUERYSAVE event:
@Command([ToolsRunMacro];“(ConsumerID)”)
This is the agent that runs
Sub Initialize
Dim agentLog As New NotesLog("Agent log")
Dim db As notesdatabase
Dim session As New notessession
Dim doc As Notesdocument
Dim doc1 As Notesdocument
Set db = session.CurrentDatabase
Set doc = session.DocumentContext
Call agentLog.OpenAgentLog
Call agentLog.LogAction("Processing:")
number = doc.ConsumerID_n(0)
If number = 0 Then
viewname = "numbers"
Set view = db.GetView(viewname)
Set doc1 = view.GetFirstDocument
nextnumber = doc1.SeqNum_n(0)
Call doc.ReplaceItemValue("ConsumerID_n", nextnumber)
Call agentLog.LogAction("Processing:"+nextnumber)
newnumb = nextnumber + 1
doc1.SeqNum_n = newnumb
Call doc.Save(True,True)
Call doc1.save(True,True)
Call agentLog.Close
End If
End Sub