how can I get the NoteId of an agent in LotusScript ?
Usually all documents have the property NoteId, but the LS Agent object does not contain this property. Yes I can search for the agent with a NotesNoteCollection, but its pretty slow, especially when its in a db with lots of agents.
Need it to verify the $AssistFlags field to detect whether it runs in the background or foreground.
I think that the only way to get the NoteID of an Agent is to use NotesNoteCollection. As the NoteID of an Agent does not change, why not treat it as a fixed value? Alternatively, it might be a good idea to keep the NoteID in a profile document, for example.
Note: for your awareness, we have launched a new Digital Solutions Community site (https://developer.ds.hcl-software.com/) which includes our new product forums
The content for our legacy product forums will soon be migrated to this new site. If you haven’t yet done so, we encourage you to sign up on the site and engage with the community of experts for our products!!
Just curious. How do you use the noteid once you get that even via notecollection. That can be sped up by setting all other options to false other than agents while building the collection. But in case some field is to be passed to an agent that could be handled via some profile document or via agent parameterdocid if called with a document context.
Im sure you have a better idea using noteid. Dont get me wrong, im Just curious to know that. I would guess you are talking about $Flags.
@Rajneesh Sharma I use the NoteId to load the agent as a document. Then I have access i.e. to the field "$AssistFlags" which gives me in this case the information whether this agent is used in the backend or foreground. Kind Regards
If you really want to, copy the ($Design) view from this db, the view lists design elements like notes document (getdocumentbykey will work, and all methods from notesdocument), if it helps everything is in the $Flags of the view, you can change formula selection of the view etc...
@Jerome Deniau Yes, thats also a solution that could work well, but I wanted to avoid to create another view ony to get the agent document .... Kind Regards
@Joe , you can use this view for many purposes, for instance instead of database properties > Design > Template version. You can use this view to display your application version ($TemplateBuild). I do use it in my apps, it is easier for the admins or users to tell me which version they run without using shortcuts, db properties, administrator etc.....