Get an Agent's NoteID Using Agent Title

Mindwatering Incorporated

Author: Tripp W Black

Created: 03/18/2011 at 02:33 PM

 

Category:
Notes Developer Tips
Agents

Issue:
You need to copy an agent to another application. However, there is no agent.CopyToDatabase call.
So instead you need to get the agent's NoteID, and then use the NoteID to get the agent as a document, and then copy it.

Solution:

CopyAgentToDatabase.txtCopyAgentToDatabase.txt

Notes:
Do not adapt this methodology to a view - it won't work right. Use LS built-in CreateView method instead.


If you need to reference the NoteID as a number (e.g. for the open command), it needs to be just the number (keeping any zeros except the leading ones).
@ReplaceSubstring(@NoteID; “NT00000″:”NT0000″:”NT000″:”NT00″:”NT0”; “”)

or

_NoneNT:= @Right (“NT001001AE”; 8);
_NoneZero:= @ReplaceSubstring(_NoneNT; “0”; “”);
@Left(_NoneZero; 1) + @Right (_NoneNT; @Left(_NoneZero; 1));



previous page