I have a Notes database that stores PO documents, there is then a Mail database with emails that have the subject line with PO Numbers. I am trying to create an agent that runs from the PO database and scans the Mail database for an email that has a subject line that matches the document in the PO database. When it is found it would create a link and save it to the document in the PO database. This would be an automated agent that would run nightly. Does anyone have some code samples, or could point me in the right direction to look?