Populate Custom Field with Automation Code Snippet
Posted: Mon Jul 08, 2019 2:47 pm
I need to get a custom field to populate with the name of the user who published a commitment to the file. I was able to get a COR to work on a test file, but when I changed the coding around for the new context, it doesn't work. My automation process says it has completed successfully, but the field I'm trying to populate isn't filled in when I go back into the order. Am I close or should I go back to the drawing board and start from scratch again? Thanks in advance.
When a document is attached
and document name contains 'Commitment'
then do the following:
run code snippet
When a document is attached
and document name contains 'Commitment'
then do the following:
run code snippet
Code: Select all
from System import *
from SoftPro.ClientModel import *
from SoftPro.Select.Client import *
from SoftPro.OrderTracking.Client.Orders import *
order = Context.Parent.Order
aFolder = IOrder.Attachments.GetValue(Context.Parent.Order)
publishedBy = IOrderItem.GetProperty(order, 'Publisher##')
for n in aFolder.Items:
if n.Name == 'Commitment':
publishedBy = n.LastModifiedBy