I have an automation that runs when a task us updated, code snippet below, but if I try to add a note value for items outside the task context it fails as undefined. Specifically we were looking for order contact name/cell numbers to add to the note.
I've used the formula editor in the note's to confirm the needed notes manually but wanted to automate the process & can add standard text/strings but alternatively would it be possible to pass a formula through the note.Text? Like -
Code: Select all
Value = {{Order.Buyers.Name}}
Code Snippet for automation:
Code: Select all
from System import *
from SoftPro.ClientModel import *
from SoftPro.Select.Client import *
from SoftPro.OrderTracking.Client.Orders import *
def AddNote():
if Context.Description == "Buyer Approval":
note = IOrder.CreateNew(Context.Root, 'Note')
Context.Notes.Add(note)
note.Text = #ex: If I wanted to pull buyers name/cell as the note
note.Categories = None
note.Type = NoteType.Information
note.DisplayOnOrderOpen = True
AddNote()