hi!, i currently have archive emails, which has some folders, with messages with the same Subject, which has the back & forth message, now I would like to take a particular thread of message and get the latest or last message replied to that subject and then forward that last message to an email address, is it possible? how can i code it? or do i need to code it? I hope Ive explained it well sir/mam, thank you very much.
example
email1 Subject OUTING
email2 RE:OUTING
so i need to get the last reply to that subject. thanks again.
Without code, the user would open the mailfile view Views>Mail Threads and look under that subject at the nested documents and find the last one.
Using code, you look on the first document and find the value of the $Orig field. Then do a search for documents with that value in the $Ref field. Check the dates on each to find the last one. You might make this easier by putting all email docs in a view in which the first sorted column was $Ref, and the second sorted column was the date/time, with newest at the top. Getdocumentbykey will return the first document that matches $Ref.
Using the $Ref field is more reliable than using the subject line, as users can easily edit the subject line when they send a reply. It isn’t bulletproof, though, as users can always copy something into a new message by way of reply.