Hi all Im having trouble with the ToolsRunMacros. Im using it within a view as an action button that calls my java agent within the same database. Now the agent has two JNI methods incase you needed to know but when I click on the view button it brings this notes exception:
NotesException: A required argument has not been provided
at lotus.domino.local.Database.NgetDocumentByID(Native Method)
at lotus.domino.local.Database.getDocumentByID(Unknown Source)
at JavaAgent.NotesMain(JavaAgent.java:17)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(NotesThread.java:218)
If anyone could help that would be appreciated
Thank you
Francisco
Subject: @Command([ToolsRunMacros]…
Francisco,
I don’t think that this has to do with the ToolsRunMacro or the JNI.
The error message seem to be pointing to the fact that the method is not getting the document UNID.
Can you please post the code snippet where you are getting the documentCollection, document, etc.
Marcus
Subject: RE: @Command([ToolsRunMacros]…
Well thank you for responding so quickly Marcus but when you mean the documentCollection, document do you mean from the action button or the agent code, sorry Im fairly new at Notes. Well heres the code for the action button that I created without using the ToolsRunMacro but using LS but this freezes Notes completely without an exception error so i gave up on it
Sub Click(Source As Button)
'uses ActionHotspot from Create under Hotspot
'this obtains the user id and places it within the Agent with
'the java file
Dim s As New NotesSession
Dim db As NotesDatabase
Dim coll As NotesDocumentCollection
Dim doc As NotesDocument
Dim agent As NotesAgent
Dim docID As Integer
Set db = s.CurrentDatabase
'seletcted documents in the view
Set coll = db.UnprocessedDocuments
'checks that only one collection is highlited at a time
If(coll.Count=1) Then
Set doc =coll.GetFirstDocument()
docID=doc.NoteID
Messagebox"the document ID "&docID
Set agent = db.GetAgent("SkypeConnect")
'Messagebox"reached setting the agent"
If (agent.Run( docID)=0)Then
Messagebox"successful running the agent"
Else
Messagebox"failed!!!!!!!!!!!!!!!!!"
End If
'Call agent.Run(docID)
'Messagebox"reached calling and running agent"
Else
Messagebox "Can only select one User to Call "&docID
End If
End Sub
Subject: @Command([ToolsRunMacros]…
Hey Marcus just solved the problem and shes running like a dream. Had a look in the help and figured it out sorry about the hastles!Francisco