Hello All,
I’ve been tasked to create a Form Letter that lists products a client has ordered. I have a formula that works well to pull the all the product fields (while suppressing the *NULL* values):
----------------------------------------------------------------------------------------------------
global stringvar Address1 := "";
global stringvar Address2 := "";
global stringvar Address3 := "";
if not IsNull({Product_Order_1}) and {Product_Order_1}
<> "" then Address1 := {Product_Order_1} + chr(44);
if not IsNull ({Product_Order_2}) and {Product_Order_2}
<> "" then Address2 := {Product_Order_2} + chr(44);
if not IsNull ({Product_Order_3}) and {Product_Order_3}
<> "" then Address3 := {Product_Order_3} + chr(44);
Address1 & Address2 & Address3
-----------------------------------------------------------------------------------------
This issue I’m having is that I must place the proper grammar/punctuation between the products. For example, if the client only ordered Product_1 then the sentence would read:
“Dear customer. Thank you for ordering Product_1.”
However, if the client ordered Product_1 & Product_2 then the sentence would read”
“Dear customer. Thank you for ordering Product_1 and Product_2.”
And, if the client ordered Product_1 & Product_2 & Product_3 then the sentence would read:
“Dear customer. Thank you for ordering Product_1, Product_2 and Product_3.”
I have no idea how to go about achieving this. My hunch is the solution is in an array. But how?
Please HELP! Any/all help would be greatly appreciated!!!!
Thanks,
Tom
I’ve been tasked to create a Form Letter that lists products a client has ordered. I have a formula that works well to pull the all the product fields (while suppressing the *NULL* values):
----------------------------------------------------------------------------------------------------
global stringvar Address1 := "";
global stringvar Address2 := "";
global stringvar Address3 := "";
if not IsNull({Product_Order_1}) and {Product_Order_1}
<> "" then Address1 := {Product_Order_1} + chr(44);
if not IsNull ({Product_Order_2}) and {Product_Order_2}
<> "" then Address2 := {Product_Order_2} + chr(44);
if not IsNull ({Product_Order_3}) and {Product_Order_3}
<> "" then Address3 := {Product_Order_3} + chr(44);
Address1 & Address2 & Address3
-----------------------------------------------------------------------------------------
This issue I’m having is that I must place the proper grammar/punctuation between the products. For example, if the client only ordered Product_1 then the sentence would read:
“Dear customer. Thank you for ordering Product_1.”
However, if the client ordered Product_1 & Product_2 then the sentence would read”
“Dear customer. Thank you for ordering Product_1 and Product_2.”
And, if the client ordered Product_1 & Product_2 & Product_3 then the sentence would read:
“Dear customer. Thank you for ordering Product_1, Product_2 and Product_3.”
I have no idea how to go about achieving this. My hunch is the solution is in an array. But how?
Please HELP! Any/all help would be greatly appreciated!!!!
Thanks,
Tom