Page 1 of 1

Buyer/Seller Prompt

Posted: Mon Feb 26, 2018 4:41 pm
by bthorson
I would like to create a document with a prompt to choose between buyer or seller and have the appropriate name and address information populated in both the heading and salutation. Does anyone have a formula that can help me with this?

For example, the prompt would produce:

"John and Tammy Smith
123 Street
Madison, WI

Dear John and Tammy,"

Thanks for any help you can provide.

Re: Buyer/Seller Prompt

Posted: Wed Feb 28, 2018 11:19 am
by BobRichards
I reached out to a ReadyDoc developer and here is his response:

Normally, what we would do for this is simply utilize the primary context of the document to simulate this "prompt" to select between buyer and seller.
Capture.PNG
Capture.PNG (83.62 KiB) Viewed 1787 times
This is the first item addressed during the rendering process. Because of its ambiguity (the Contacts collection is filtered to both Buyers and Sellers) -- IF more than one contact exists…the user will be prompted to select which contact(s) the document should be rendered for. Then, in the document itself, the field codes used to pull the Name and Address data would be coded relative to the Primary Context:

{{.Name}}
{{.Address.Address1Address2}}
{{.Address.CityStateZip}}

These fields exist on both the Buyer and Seller context -- so, whichever contact is chosen, the document will pull the data accordingly.

Re: Buyer/Seller Prompt

Posted: Wed Feb 28, 2018 2:48 pm
by bthorson
Thanks Bob. I was able to get this prompt to work corectly on the document heading.

As a follow up question, I would like to have the buyer or seller first names (as opposed to the full names) show up in the letter greeting, based on the original prompt. Currently I am using a formula like this for buyer and a similar one for the seller:

<IF ({{Order.Buyers.IndivOrOrg}} = "Individual")>
Dear {{Order.Buyers.Individual1.FirstName}}<IF (Not IsEmpty({{Order.Buyers.Individual2.FirstName}}))> and {{Order.Buyers.Individual2.FirstName}}</IF>,
<ELSE>
Dear {{Order.Buyers.People[1].FirstName}},
</IF>

Given the new primary context, do you have any suggestions for how I could modify this to fill in the appropriate first names in the greeting line?

Thanks again for all your help, it's sincerely appreciated.

Re: Buyer/Seller Prompt

Posted: Wed Feb 28, 2018 3:28 pm
by BobRichards
You do not need to type the "Order.Buyers" in the field descriptors. When you enter the body of the document, the context is already a buyer or seller. I have made the changes in your document fragment.

Code: Select all

<IF ({{.IndivOrOrg}} = "Individual")>
Dear {{.Individual1.FirstName}}<IF (Not IsEmpty({{.Individual2.FirstName}}))> and {{.Individual2.FirstName}}</IF>,
<ELSE>
Dear {{.People[1].FirstName}},
</IF>

Re: Buyer/Seller Prompt

Posted: Fri Mar 02, 2018 4:22 pm
by bthorson
Bob, thank you for all your help. This formula worked perfectly.