Automation for Moving Documents to Folders

Questions about and code samples for automation process code snippets within Select.
BobRichards
Posts: 929
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Automation for Moving Documents to Folders

Post by BobRichards » Mon Mar 02, 2020 1:02 pm

Context.Parent.Path will yield a string like: " \\XAT20000051\Attachments\". I'm not sure what "destFolder.Path" is in your code. Since the code only compares folder names, it should prevent the move action if the folders are the same. I think you should be checking that the filenames are the same and preventing it. In case you are interested, I put an example of the different properties available to the AttachmentFile Context.

Automation snippet results if filename "GetEventNotificationQueueID method.txt" is loaded into top level attachment folder on order number XAT20000051.
Context returns IAttachmentItem
(i.e.) str(Context) == "Attachments\GetEventNotificationQueueID method"

Context.ID returns Guid
(i.e.) str(Context.ID) == "ce104b6d-bb3b-4c1c-b127-ee90f8d03b33"

Context.Name returns string
(i.e.) Context.Name == "GetEventNotificationQueueID method"

Context.Order returns IOrder
(i.e.) str(Context.Order) == "Order XAT20000051"

Context.Parent returns IAttachmentFolder
(i.e.) str(Context.Parent) == "Attachments"

Context.Path returns string
(i.e.) Context.Path == "\\XAT20000051\Attachments\GetEventNotificationQueueID method.txt"

Context.Parent.Path returns string
(i.e.) Context.Path == "\\XAT20000051\Attachments\"
Bob Richards, Software Developer, SoftPro

Post Reply