The following formulas are very useful in SmartIcons, so you don´t have to create an agent in every database for them.
To get the NoteID of the selected document:
@Prompt([OKCANCELEDIT]; "NoteID"; "NoteID"; @Text(@NoteID));
To get the UNID of the selected document:
@Prompt([OKCANCELEDIT]; "UNID"; "Unique ID"; @Text(@DocumentUniqueID));
To run the opened agent:
To set a field in the selected document, use the attached EditField.txt file. I found this in the LDD Sandbox a long time ago, and a new version that works better in R6 has been created.
An even newer version can be found here.