3000AD Knowledge Base
Home » Categories » Knowledge Base Home » PDF-eXPLODE » Tips N Tricks

I would like to make a multiple condition Tag that can incorporate different destination emails depending on some company location


My tag is currently used exclusively for SEATTLE. However I need to extend the Message ID Tag used for Seattle, to include ANCHORAGE and FAIRBANKS. However, all Anchorage and Fairbanks invoices must be reviewed before emailing and additional documents are to be attached to the outgoing PDF-eXPLODE email.

For instance, 

 - Anchorage invoices will explode to a hard-coded email address: mary.someone@MyGroup.com (Mary cannot send Invoices direct to the customer, because she needs to attach additional documentation before she sends.)

Fairbanks invoices will explode to a similarly hard-coded email : mona.goodyear@MyGroup.com  (because she must also hit “Forward” on the email and send to customer after adding additional backup documentation.)

I can easily make 2 different Crystal reports and hard code the users into it; I was just wondering if there is a more efficient way. 


Suggestion 1

In Crystal Reports, click on the "New" Formula button on the Field Explorer toolbar. Give it a name like "PeXTag". Now you will open the Formula Edit screen and in the space provided for Formula code, type the following:

 If {CoyCode} = "ANCHORAGE” Then

  "<pdfexplode>"+ Var1+ "," + Var2+ "%Message#mary.someone@MyGroup.com</pdfexplode>"

Else if  {CoyCode} = "FAIRBANKS” Then

  "<pdfexplode>"+ Var1 + "," + Var2+ "%Message#mona.goodyear@MyGroup.com</pdfexplode>"


     "<pdfexplode>" + Var1 +"," + Var2 + "%Message#" + {Email_Addr} + "</pdfexplode>"

"Var1" ..."Var9"  
are database fields separated by commas except for the last Var which must end with a '%'
"Message" is the one-word name for your Message ID (process run ID name)
{Email_Addr} is a database email field.

Click the X 2 Check (Formula) button and if OK, then click Save and Close button.
Now place a text field in your report preferably in the header and ensure that it extends the width (excluding margins) of the page. Then drag the Formula field just created, into this text box and it will display as @PeXTag. In PDF-eXPLODE, ensure you have configured the Variables menu. You are now all set.  The tag will be dynamically calculated and displayed on an Invoice page depending on the {Coycode} for the current data record. In doing so, the appropriate action will be processed if the Invoice is destined for Anchorage or Fairbanks.

Suggestion 2

Make 2 copies of your current "Invoice" report (for Seattle Invoices) and name them "AnchorageInvoices" , FairbanksInvoices" and replace the {Email_addr} data field in the tag with hard-code email address for each location.

Suggestion 3

You can attach additional documents to exploded Invoices using the Variable Coversheet feature available in versions 3.3.9+ (Dec 2012) which will allow you to attach ANY TYPE of file from a pre-configured file path in the Message ID. Each document name including file extension must be included as a variable in the document tag and each variable is specific to data in the tag and it vary from tag to tag. 


Suggestion 4

For these 2 locations (Fairbanks and Anchorage), use Emailing via MAPI /MS Outlook and check the box Send as DRAFT. Then you open EACH ONE and attach the relevant documents and click send when ready. 


Comments Comments
There are no comments for this article. Be the first to post a comment.
Security Code Security Code

Subscribe to Knowledge Base

Get notified when new articles are added to the knowledge base.