Corrupted Code Snippets for Task Automation
Posted: Sat Feb 17, 2024 1:45 am
Hi there!
I am fairly new to softpro & and code snippets (1 year in), but am doing everything I can to learn so hopefully you can bear with me
We have Automated code snippets in place to update our tasks, but it seems that 2 of our code snippets are corrupted as when we try to save a file (or publish documents) we will frequently (although sporadically) receive error messages which refer us back to the 2 Automation code snippets (either 145 Code, or 150 Code). When these error messages occur, Softpro won't let us save/publish the first time around, but will eventually allow us to save (or publish) on the second go around.
Our intent is to still utilize the function of the SSN/TaxID to update our tasks, but just need uncorrupted snippets that won't cause errors. Thank you so very much for your help and assistance!
I am fairly new to softpro & and code snippets (1 year in), but am doing everything I can to learn so hopefully you can bear with me
We have Automated code snippets in place to update our tasks, but it seems that 2 of our code snippets are corrupted as when we try to save a file (or publish documents) we will frequently (although sporadically) receive error messages which refer us back to the 2 Automation code snippets (either 145 Code, or 150 Code). When these error messages occur, Softpro won't let us save/publish the first time around, but will eventually allow us to save (or publish) on the second go around.
Our intent is to still utilize the function of the SSN/TaxID to update our tasks, but just need uncorrupted snippets that won't cause errors. Thank you so very much for your help and assistance!
Code: Select all
"CODE SNIPPET 145"
#Evaluate if Buyer SSN is populated
#Context = Buyer
def SSNPopulated():
contact = Context
organization = int(contact.BuyerSellerType.Organization)
if int(contact.BuyerSellerType) & organization > 0:
# Organization
if contact.Name:
if contact.TaxID:
return True
else:
# Individual: Joint, Male or Female
for people in contact.People:
if people.Name:
if people.SSN:
return True
SSNPopulated()
Code: Select all
"CODE SNIPPET 150"
#Evaluate if Seller SSN is populated
#Context = Seller
def SSNPopulated():
contact = Context
organization = int(contact.BuyerSellerType.Organization)
if int(contact.BuyerSellerType) & organization > 0:
# Organization
if contact.Name:
if contact.TaxID:
return True
else:
# Individual: Joint, Male or Female
for people in contact.People:
if people.Name:
if people.SSN:
return True
SSNPopulated()