After research the SDK and applying about 40 permutations to my snippet, I keep receiving the same two errors, randomly. The same code will produce one of the two errors at different times.
Code: Select all
# Pull All of from System import *
from SoftPro.ClientModel import *
from SoftPro.OrderTracking.Client import *
from SoftPro.OrderTracking.Client.Orders import *
from SoftPro.OrderTracking.Client.Orders import IOrder
# Handle Disambiguate
def Lookups_DisambiguateLookupRow(sender, e):
e.SelectRow(e.LookupTable.Rows[0])
def Are_MrkSrcReps_OrderContacts():
errors = ""
# Disambiguate
lookupsMgr = Context.Root.GetService(ILookups)
lookupsMgr.DisambiguateLookupRow += Lookups_DisambiguateLookupRow
## Removed Logic
for mrkSrcRepCode in MrkSrcRepCodes:# Loop Reps and look for ord level match
if mrkSrcRepCode[0] not in OrdLvlMrkRepCodes:# Create Contact
try:
# Create New Rep and set code
newMrkRep = IOrder.CreateNew(Context, 'Other')
newMrkRep.OtherType = "Marketing Rep"
newMrkRep.LookupCode = mrkSrcRepCode[0] # if commented no errors
Context.Contacts.Add(newMrkRep)
except Exception as err2:
errors += "ERROR1: "+ str(err2)
if errors != "":
NoteError(errors)
Are_MrkSrcReps_OrderContacts()
The two errors I recieved consistently are:
- Global Name "e" is not defined (it is present in the disambiguate function)
- Expected Int, got string
Notes:
- The function did work to add a contact from the lookuptable, but it only happened once and I could not reproduce it.
- Running .41.
At a loss at this point.
Please let me know if you have any ideas.