HomeTechnical Support » E-mailing

E-mailing

PB# Assign EmailBody query Messages in this topic - RSS

paula
Administrator
Posts: 208


3/28/2011
paula
Administrator
Posts: 208
One other note, I did not notice until I added the last message that the delimiters are not closed oin many of the #Assigns commands. Delimiters must always be entered as matching pairs. For example:

#Assigns EmailBody, ÷Dear Customer÷,
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Please find attached your invoice for sales in February 2011.÷
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Should you have any queries please do not hesitate to contact us. ÷
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷BCXYZ÷
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷xyz÷
#Assigns EmailBody, ÷xyz.com÷

Notice there is a delimiter before and after text entry.
0 link
paula
Administrator
Posts: 208


3/28/2011
paula
Administrator
Posts: 208
The syntax for the #If/#ElseIf/#Endif commands are available in the PrintBoss Manual as well by by right clicking in either Footer or RunTime Objects of the PrintBoss Form and selecting List/Stuff Assignments. Expand the Substitutions Functions section to see the syntax for If. Elsif is the same and Endif typically stands on its own. The following is an example:

#If «[=e, ÷{CodETERR}÷, 'ENG']»
#Assigns EmailBody, ÷Dear Customer,
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Please find attached your invoice for sales in February 2011.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Should you have any queries please do not hesitate to contact us.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷BCXYZ
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷xyz
#Assigns EmailBody, ÷xyz.com
#ElseIf «[=e, ÷{PricList}÷, 'EURTAG'][=e, ÷{CodETERR}÷, 'FRE']»
#Assigns EmailBody, ÷Mesdames et Messieurs,
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Veuillez trouver etc etc.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷etc etc:
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷etc etc.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Sincères amitiés
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷RB
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷XYZ
#EndIf

The =e Condition specifies an exact string match. Double click on the #If or #EndIf command and select the button at the end of the "True" field for a complete list of conditions and their syntax. Notice no symbol is required in the #EndIf to signify this is an 'And' statement. 'And' is the default. Use a double pipe symbol, ||, between two conditions to indicate 'Or'.

The Else section in your example is fine as is.
edited by Nancy on 5/2/2012
edited by Nancy on 5/2/2012
0 link
Eva
Posts: 6


3/28/2011
Eva
Posts: 6
Thanks for that but this is driving me crazy!
I have an #IF/#ELSEIF/#ENDIF series of assigns as per below in the footer options but when I print a number of invoices, it is just putting the correct email body on the last email, not on every email. I have also tried it in the Runtime options.
Since the client is printing 800 invoices at a time, this isn't going to work.
Weirdly, it is picking up the first word for each invoice except the last one where it works.

Additional assistance would be greatly appreciated.
Eva

#if CODETERR = "ENG"
#THEN
#Assigns EmailBody, ÷Dear Customer,
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Please find attached your invoice for sales in February 2011.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Should you have any queries please do not hesitate to contact us.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷BCXYZ
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷xyz
#Assigns EmailBody, ÷xyz.com

#elseif PRICLIST = "EURTAG" and CODETERR = "FRE"
#then
#Assigns EmailBody, ÷Mesdames et Messieurs,
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Veuillez trouver etc etc.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷etc etc:
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷etc etc.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Sincères amitiés
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷RB
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷XYZ

#elseif PRICLIST= "CHF" and CODETERR = "ITA"
#THEN
#Assigns EmailBody, ÷Vi ringraziamo per appoggiare etc etc.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷In allegato troverà la etc etc.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Non esitate a contattarci etc etc.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Grazie.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷xyz
#Assigns EmailBody, ÷
#Assigns EmailBody, ÷Mrs xyz

#ELSE
#Assigns EmailBody, ÷Dear xyz Customer,
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷Please find attached your invoice for sales in February 2011.
#Assigns EmailBody, ÷
#Assigns EmailBody, ÷Should you have any queries please do not hesitate to contact us.
#Assigns EmailBody, ÷÷
#Assigns EmailBody, ÷XYZ
#Assigns EmailBody, ÷
#Assigns EmailBody, ÷XYZ
#Assigns EmailBody, ÷xyz.com
#endif
0 link
paula
Administrator
Posts: 208


3/25/2011
paula
Administrator
Posts: 208
PB#Assign must be a single string with no space between # and Assign.

An alternative solution is to place the conditional fields, i.e. {ARCUS.CODETERR}, directly on the crystal report and assisgn the fields in PrintBoss. The assignment dialog includes an option to Blank Out these fields so they will not display on the document. Then use the #IF/#ELSEIF/#ENDIF commands to build the condition in the Footer Objects tab of the PrintBoss form. Use "#Assigns EmailBody," to build the the custom text for each condition. A new #Assigns should be used for each new line of text. The body of each #IF/#ElseIf section will look something like the following with spaces between the delimiters on every other line to create an empty line when desired:

#Assigns EmailBody, ÷Please find attached your invoice for sales in February 2011.÷
#Assigns EmailBody, ÷ ÷
#Assigns EmailBody, ÷Should you have any queries please do not hesitate to contact us.÷
#Assigns EmailBody, ÷ ÷
#Assigns EmailBody, ÷Barbara C÷
0 link
Eva
Posts: 6


3/25/2011
Eva
Posts: 6
Hi,
I am trying to get PB# Assign EmailBody to work. If I put the formula into Crystal which is simply one long sentence, then it works however I need that formula to be a conditional one as per the one following and all it does is print the first line. Is there any way to have a formatted body that relies on information from the data files?

This is a portion of the formula

PB# Assign EmailBody,"+
(if {ARCUS.CODETERR} = "ENG"
then ( "Dear Customer,"+ chr(13) +
" "+ chr(13) +
"Please find attached your invoice for sales in February 2011."+ chr(13) +
" "+ chr(13) +
"Should you have any queries please do not hesitate to contact us. "+ chr(13) +
" "+ chr(13) +
"Barbara C ")
else
if {ARCUS.PRICLIST} = "NOKTAG"
then " Kjaere XYZ,"+ chr(13) +
" "+ chr(13) +
"Vedlagt finner du fakturaen ."+ chr(13) +
" "+ chr(13) +
"Takk,"+ chr(13) +
" "+ chr(13) +
"Med vennlig hilsen,"+ chr(13) +
" "+ chr(13) +
" "+ chr(13) +
"AS"
Else
if {ARCUS.PRICLIST} = "EURTAG" and {ARCUS.CODETERR} = "ITA"
then " Vi ringraziamo per appoggiare il nostro Servizio

and so on and it continues for about 20 different options.


Any assistance would be very much appreciated.
Regards
Eva
0 link






Powered by Jitbit Forum 8.3.8.0 © 2006-2013 Jitbit Software