I have been able to create simple Code Snippets, using examples and basic logic, but apparently, I am not getting how to check the value of the {{Order.Sellers.Proceeds.Is1099Provided}} Field.
I assume that I need to use "for seller in Context.Sellers:" to loop through the Sellers. However, ".Proceeds" appear to be of type "SellerProceeds", with "Is1099Provided" being a property of that object.
After various failed attempts trying to determine if any of the sellers had the Is1099Provided set to True, I was wondering if you could please provide a basic example of how this can be done.
Ultimately I am trying to add a Task to the order when any of the Sellers has the Is1099Provided checked. (i.e. First time any of them gets checked, but not each time one is checked.)
Thank you in advance for your assistance.
SellerProceeds.Is1099Provided
Re: SellerProceeds.Is1099Provided
I cannot seem to find a way to edit/add to my original post, so I am replying with the following information just in case it promotes someone to pity my feeble efforts.
The code that I was experimenting with is below, with several of my failed attempts commented out.
I am reasonably sure that I need to use "for seller in Context.Sellers:" to loop through each of the Sellers, unless there is a simple way to test for any of the sellers having the field checked with a single statement, as this is all I am trying to determine. My issue seems to be with the ".Is1099Provided" being under the context of "SellerProceeds" or at least that is what I am thinking.
from System import *
from SoftPro.ClientModel import *
from SoftPro.Select.Client import *
def WasProvided():
for seller in Context.Sellers:
#if seller.Proceeds.Is1099Provided = True:
#if seller.SellerProceeds.Is1099Provided = True:
#proceed = seller.SellerProceeds
#proceed = seller.Proceeds
#if proceed.Is1099Provided = True:
#if Context.SellerProceeds.Is1099Provided = True:
#if Context.Proceeds.Is1099Provided = True:
#proceed = Context.SellerProceeds
if ?.Is1099Provided = True:
return True
return False
WasProvided()
The code that I was experimenting with is below, with several of my failed attempts commented out.
I am reasonably sure that I need to use "for seller in Context.Sellers:" to loop through each of the Sellers, unless there is a simple way to test for any of the sellers having the field checked with a single statement, as this is all I am trying to determine. My issue seems to be with the ".Is1099Provided" being under the context of "SellerProceeds" or at least that is what I am thinking.
from System import *
from SoftPro.ClientModel import *
from SoftPro.Select.Client import *
def WasProvided():
for seller in Context.Sellers:
#if seller.Proceeds.Is1099Provided = True:
#if seller.SellerProceeds.Is1099Provided = True:
#proceed = seller.SellerProceeds
#proceed = seller.Proceeds
#if proceed.Is1099Provided = True:
#if Context.SellerProceeds.Is1099Provided = True:
#if Context.Proceeds.Is1099Provided = True:
#proceed = Context.SellerProceeds
if ?.Is1099Provided = True:
return True
return False
WasProvided()
-
- Posts: 1380
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: SellerProceeds.Is1099Provided
You are correct that you need to write a loop to examine all the sellers - one at a time. Proceeds as a property of a Seller Is1099Provided is a property of Proceeds. So you should be able to do something like this...
(Also, I changed your code to use double equals sign. That's how Python does comparisons. Single equals means assignment.)
Code: Select all
for seller in Context.Sellers:
if seller.Proceeds.Is1099Provided == True:
return True
Bob Richards, Senior Software Developer, SoftPro
Re: SellerProceeds.Is1099Provided
Thank you for your reply.
I change the code as follows but still had no luck detecting that the second seller has this field checked. For testing purposes, I have set this process to "Every Time" the order is saved.
The process looks as follows:
I change the code as follows but still had no luck detecting that the second seller has this field checked. For testing purposes, I have set this process to "Every Time" the order is saved.
Code: Select all
from System import *
from SoftPro.ClientModel import *
from SoftPro.Select.Client import *
def WasProvided():
for seller in Context.Sellers:
if seller.Proceeds.Is1099Provided == True:
return True
return False
WasProvided()
Code: Select all
Every time an order is saved
and owning profile is under 'Default\zTesting Only\zAutomation Testing'
and Order.ReceivedDate is >= 02/26/2019
and a code snippet evaluates to true
then do the following:
add a 1099 Reporting Test task
Re: SellerProceeds.Is1099Provided
Just for a test, I tried hardcoding the Snippet to look specifically at the second seller, but this did not work either.
Code: Select all
from System import *
from SoftPro.ClientModel import *
from SoftPro.Select.Client import *
def WasProvided():
if Context.Sellers[1].Proceeds.Is1099Provided == True:
return True
return False
WasProvided()
Re: SellerProceeds.Is1099Provided
It is now working...
Thank you.
Thank you.