Conditioning Sellers' Addresses

Discussions related to ReadyDoc development.
Post Reply
applelisa
Posts: 6
Joined: Wed Feb 07, 2018 2:41 pm

Conditioning Sellers' Addresses

Post by applelisa » Thu Feb 08, 2018 4:47 pm

Hello,

In situations where there are two or more sellers ({{Order.Sellers.Code}} = "S" and {{Order.Sellers.Code}} = "S2") if their property addresses are different, we need both addresses to be shown on the ReadyDoc. The word "and" needs to separate the two addresses. Otherwise, if the addresses are the same, only one needs to populate. How can I go about doing this?

Thanks!

BobRichards
Posts: 1006
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Conditioning Sellers' Addresses

Post by BobRichards » Mon Feb 12, 2018 4:40 pm

The following code will enumerate all Sellers and display the information with appropriate commas and "and".

Code: Select all

<VAR $Counter (0)><VAR $Total (0)><VAR $Total (<COUNT {{Order.Sellers}}>)><FOREACH {{Order.Sellers}}><VAR $Counter ({{$Counter}} + 1)><IF ({{$Counter}}>1)><IF ({{$Counter}}<{{$Total}})>, <ELSE> and </IF></IF>{{.Address.FullAddress}}</FOREACH>
Bob Richards, Software Developer, SoftPro

applelisa
Posts: 6
Joined: Wed Feb 07, 2018 2:41 pm

Re: Conditioning Sellers' Addresses

Post by applelisa » Mon Feb 12, 2018 4:56 pm

That worked - thank you very much for your help!

Post Reply