Overview

Fax automation can be configured within the A5 Fax app or with process automation using Salesforce automation tools. This article will provide information about how to set up fax automation with each of these options. 

  1. General Setup
  2. A5 Fax App
  3. Process Automation
    1. Process Builder
    2. Flow
    3. Apex

General Setup

  • A5 Fax only works with files/documents/attachments in PDF format. Options for creation of the PDF include the following options: A5 Documents, any 3rd party document generation apps like Conga Composer, or the “create PDF Quote” standard Quotes feature in Salesforce.
  • Any custom lookup field can be used to relate the sent fax record to another object record. By default the app comes with lookup fields to the following standard objects: Account, Contact, Case, and Opportunity.
  • The A5 Fax automation tool built in feature is only compatible with attachments format, not files or documents. Salesforce automation can be configured to create a sent fax record using either attachments, files, or documents. Note the following information about record Ids to reference when using attachments and files:

Fax Automation within A5 Fax App

The standard fax automation tool provided by A5 Fax is based on the Attachment insert and filename. You can configure the app to automatically fax a PDF that gets attached to any record by following these steps:

  1. Make sure all A5 Fax users have enabled the “Send Outbound Messages” permission on their individual profile or with a permission set.
    • If they do not enable this Salesforce System Permission on the Profile level or via a permission set, they will not be able to successfully send outbound faxes where the Outbound Messaging was necessary. This pertains to using automation features of A5 Fax; they will still be able to send faxes manually.
  2. Go to Setup, Installed Packages and click “Configure” link next to the A5 Fax app (or go to Fax Configuration tab).
  3. In the section “Field Settings” click “New” button.
  4. Give this setting a name that provides some description to you like “Auto Send Fax to Contact”.  It could be much more specific if configuring for a certain type of process or document.  Overall, the Setting Name is just for informational purposes.
  5. Select the Object the Fax is related to.
  6. Select the lookup field on the Sent Fax object that provides the relationship to that object.
  7. Select the lookup field on the Received Fax object that provides the relationship to that object.
  8. Indicate the location of the “send to” Fax Number.  You can reference a field in the object or the fax attachment filename.
    • Field reference: If the fax number is in a field, select “In Object Field” then select the field.
    • Attachment Filename: If the fax number is in the attachment filename, then select In Fax Attachment Filename”, and indicate where to find the fax number in the filename using “before” or “after” and the specific text.  For example, you could have a process that creates an attachment with the filename “FAX-837-738-3827.pdf” where “FAX-” is always consistent and the number after is always the fax number.  Then you can select “after” and put in “FAX-” in the text field.
  9. Indicate what the filename of the attachment related to this object should contain in order to auto send the fax.  Use the matching criteria of “starts with”, “contains”, or “ends with” and input the specific text.  For example, the file could always start with the word “Fax”.  Once you attach a PDF file to the object record with this same pattern (in this example, filename starting with the word “Fax”) the attachment will be auto faxed to the specified recipient.
  10. Next, indicate the placement of the barcode on your fax document that will remain in the same place each time a fax is sent with this field setting. If you would like to preview how the barcodes would look on an example PDF image, you can select a PDF file from your documents or upload one using the lookup glass next to Fax PDF File.
    • The first barcode is in the default position. You can move the barcode around by clicking on it and holding down mouse and dragging it around.
    • You can also drag the corner of the barcode to resize it.  The larger the barcode the easier the app will be able to read it when it is faxed back.
    • You can also use the controls on the left to move and size the barcode.
    • You can also add another barcode to the document by clicking the Add Barcode button.  This is optional but recommended.  Sometimes when faxes come back an area of the fax gets distorted or has a hair in it.  Having two barcodes on the page increases the chance of successfully reading one.
  11. Upon inserting a new Attachment, the A5 Fax trigger will automatically read the filename and, if it matches the rule, will automatically create a Sent Fax record and fax the attachment.

Note: If you are mass updating multiple records at once and this results in more than one Attachment, then the A5 Fax Fax trigger will detect the need for Batch Mode and will create the Sent Fax record and check the box “Sent with Outbound Message” and a A5 Fax workflow rule will send outbound message to A5 Fax server to send the fax.  This is more of an FYI.

Process Automation

If you do not want to use the standard fax automation configuration tool provided by A5 Fax that is based on the Attachment insert and filename, you can fax with any process automation tool (Process Builder, Flow, Apex trigger or class).

If you plan to write your own automation, disable the Autosend feature in A5 Fax Configuration. There is checkbox under fax configuration that says “enable auto send faxes” which you can uncheck if not using.

You can configure your automation tool of choice to create a sent fax record once a specific triggering event occurs. For example, you could configure process builder to create a sent fax record when a related record is created or edited to meet certain criteria. Or, configure a VisualForce page that launches a Flow when a user clicks a button on a page. Similarly, any platform event can invoke an Apex trigger or class to create a sent fax record.

Process Builder

Every process consists of a trigger, at least one criteria node, and at least one action. You can configure any trigger and criteria to result in the creation of a sent fax record, depending on your organization’s business processes. For example, when a custom checkbox field “fax enrollment report” equals “true” it triggers the action to create a sent fax record.

How to configure a Process Builder action to create a sent fax record:

  • Fax Number (efaxapp__Fax_Number__c): Mandatory field. This is the number to which the fax will be sent.
    • IMPORTANT NOTE: Fax Number format for automation methods needs to be in following clean format: 8665557220 (there should not be any parentheses, dashes, hyphens, or slashes in number format within automation method).
    • You can also use formula instead of string and put this reference: $Setup.efaxapp__eFax_General_Settings__c.efaxapp__Default_Fax_Number__c. This will take a value of Default Fax Number from eFax General Settings custom setting. That way when you change the default fax number, you won’t have to change every action/condition in your process builders.
  • Send Date (efaxapp__Send_Date__c): Mandatory field. This is the date when the fax should be sent, most commonly set to TODAY().
  • Subject (efaxapp__Subject__c). Mandatory field. This is the subject of the fax.
  • Attachment ID (efaxapp__Attachment_ID__c): Mandatory field. This is the Id of the attached file/document/attachment.
  • Attachment ID2 (efaxapp__Attachment_ID2__c) – Attachment ID10 (efaxapp__Attachment_ID10__c): Optional field. This is the Id of any additional attached files/documents/attachments. For example, to attach a cover page. You can send a max of 10 attachments in one fax.
  • Organization Fax Number (efaxapp__Org_Fax_Number__c): Optional field. This is the number from which fax will be sent, if not set it should be the default org fax number.
  • Sent With Outbound Message (efaxapp__Sent_With_Outbound_Message__c): Optional field. This is a boolean field which, if the value is set to true, indicates that the fax will be sent as soon as the job picks it up. The fax will not be sent if the value of this field is false. The default value of this field is false.
  • Barcode Position from Left (efaxapp__Barcode_Position_Left__c): Optional field. Sets the position of the QR code from left edge of the document in pixels.
  • Barcode Position from Top (efaxapp__Barcode_Position_Top__c): Optional field. Sets the position of the QR code from top edge of the document in pixels.
  • Barcode Size Width (efaxapp__Barcode_Size_Width__c): Optional field. Sets the QR code width in pixels.
  • Account (efaxapp__Account__c):Optional field. This is a lookup that can be used to relate the fax record to standard Account record.
  • Contact (efaxapp__Contact__c) – lookup that can be used to relate the fax record to standard Contact record, optional
  • Case (efaxapp__Case__c): Optional field. This is a lookup that can be used to relate the fax record to standard Case record.
  • Opportunity (efaxapp__Opportunity__c): Optional field. This is a lookup that can be used to relate the fax record to standard Opportunity record.

Flow

You can launch a Flow that creates a sent fax record (Figure 1) in many ways, such as from a Process Builder action (Figure 2) or by clicking a button on a page.

How to configure a Flow to create a sent fax record:

  1. Create two variables, one for target record Id and another for fax number (Figure 3 & 4).
  2. Use Get Records to get the latest Content Document Link record related to target record. This record has all the information we need (Figure 5).
  3. Use Create Records to create a Sent Fax record and set its fields. As explained in the “General Setup” section of this article, the use of files versus attachments will affect how you configure the automation. This example shows setup for an org that uses files; the Flow references Latest Published Version Id field on Content Document record (Figure 6).

Figure 1. Diagram of the Flow:

Figure 2. Invoke a Flow from Process Builder. Select Launch a Flow, and pass it the target record Id and fax number. This example references a record related to the Account object.

Figure 3. Configuration of a variable used to store target record Id passed from process builder, which we named varAccountId:

 

Figure 4. Configuration of a variable used to store fax number passed from process builder, which we named varFaxNumber:

 

Figure 5. Configuration of Get Records action. We named the action Get Latest Content Document Link. Notice the sorting of  fetched records. We do that to make sure that the latest record is selected. The record is saved in the automatically created variable which has the same name as the API name of the Get Records action, Get_Latest_Content_Document_Link:

 

Figure 6. Configuration of Create Records action. We named it Create Sent Fax. Notice that not all fields are set, just mandatory ones, Account, and Sent With Outbound Message. To set Attachment ID we used {!Get_Latest_Content_Document_Link.ContentDocument.LatestPublishedVersion.Id}, where Get_Latest_Content_Document_Link is the API Name of the Get Records action we used to get Content Document Link record. Instead of {!Flow.CurrentDate}, you can also use {!Flow.CurrentDateTime}:

Apex

 

Write Apex class or trigger that will Insert a Sent_Fax record with the following value guidelines:

efaxapp__Sent_Fax__c fax = new efaxapp__Sent_Fax__c(

      efaxapp__Fax_Number__c = ‘8665557220’, //Mandatory. This is the recipient’s fax number. Format needs to be clean, with no parentheses, dashes, hyphens, or slashes.

      efaxapp__Subject__c = ‘Test’,  //Mandatory. Any text to populate the subject.

      efaxapp__Send_Date__c = Datetime.now(), // Mandatory. Typically current date/time as depicted in the code, but this can also be configured to send the following business day, on a specific day of the month, etc. 

      efaxapp__Attachment_ID__c = ’00Pi000000LwrJTEAZ’, // Mandatory. This example references the Id of a specific attachment. You could also set Attachment ID as we set up the Flow in the previous section, which used the Get Records action to get Content Document Link record.

      efaxapp__Status__c = ‘Sending’, // Mandatory

      efaxapp__Sent_With_Outbound_Message__c = True, // Mandatory

      efaxapp__Org_Fax_Number__c = ‘4158880447’, // Mandatory. Org fax number from which to send.

      efaxapp__Barcode_Position_Top__c = ’30’, // Optional. Barcode options.

      efaxapp__Barcode_Position_Left__c = ’30’, // Optional. Barcode options.

      efaxapp__Barcode_Size_Width__c = ’30’ // Optional. Barcode options.

    );

    insert fax;

To add a second barcode position to the Apex automation:

You can add new positions/size via a comma, for example:

efaxapp__Barcode_Position_Top__c = ‘17,245’,
efaxapp__Barcode_Position_Left__c = ‘211,45’,
efaxapp__Barcode_Size_Width__c = ‘54,54’
 
where second integers (245,45,54) related to a second barcode.