Table of Contents

Chargent Documentation

Customizing Chargent

Calculating & Customizing Amounts

Chargent Anywhere will create a Chargent Order record with different fields that make up the Total. You can customize the fields by understanding which fields are sent to the payment gateway and creating Workflow Rules that update the Charge Amount on the Chargent Order. Here is a list of fields that make up the Total.

On the Chargent Orders record, The Total field is the sum of the Subtotal plus the Tax and Shipping fields. The Tax and Shipping fields are optional.

Charge Amount: This is the field Chargent sends to the payment gateway, so it determines the actual amount of the payment. This amount must be greater than $0 for charges or authorizations and defaults to the Balance Due unless the Manual Charge option is checked.

Manual Charge: When checked, and a Charge Amount is specified, Chargent will not change the Charge Amount. This allows you to perform multiple transactions against a single Chargent Order without the Charge Amount being recalculated each time, a frequent requirement for recurring billing.

Note: If the Manual Charge box is NOT checked, Chargent uses a Workflow Rule to copy the Balance Due to the Charge Amount field. You can create your own Workflow Rule if you want to calculate the charge amount a different way.

The Balance Due is calculated based on the Total minus any previous approved charges or refunds.

Email Receipts and Notifications

If you are sending receipts from Salesforce, you should disable Email receipts from your Payment Gateway. Most Payment Gateway interfaces have a setting to turn receipts off.

Most payment gateways will send an email receipt automatically to your customer, as soon as a charge (authorization and capture) goes through. The email address that Chargent sends to the Payment Gateway is the Billing Email field.

Key Chargent fields for Receipts

  • Billing Email: This will be the email address the payment gateway will send an email to
  • Order Information -- This usually appears in the "Description" field of the gateway receipts. This field is limited to 255 or fewer characters.
  • Invoice Number -- This sends the invoice number to the gateway.
  • Charge Amount -- This is the amount that Chargent sends to the payment gateway.

Preventing Gateway Receipts

You can often control whether a receipt is sent or not by logging into your payment gateway web interface and altering the settings there.

If you don't want your customer to receive the email, or you wish to send them your own email receipt from Salesforce with your branding / formatting, one option is removing the email address from the Billing Email field on the Chargent Order.

Sending Email Receipts from Salesforce

Chargent stores all billing and transaction data 100% natively inside Salesforce. You can modify the email template in Salesforce to use Chargents trigger to send personal email receipts using your company’s logo and custom fields. You can also create your own Workflow and Trigger with your own custom information. Check out Customizing Chargent Email Receipts and Notifications for more information.

Receipt Considerations

If your payment gateway does not have a receipt setting, you should contact their support. You can also simply leave the Chargent Billing Email field blank, so it will not be sent to the payment gateway.

The Chargent Customer Receipt workflow rule uses the following criteria:

  • Transaction: Response Status = Approved
  • Transaction: Type = Charge

If you are manually entering paper check or cash transactions in Chargent, and don't wish to send receipts for those transactions, you can modify the Workflow rule to add an additional criteria such as:

  • Transaction: Payment Method = Credit Card

Customizing Email Receipts

To create a custom notification using your own Workflow Rules, see the examples below.

For more information on Workflow Rules, please see the Salesforce Workflow Documentation. We recommend testing all new Workflow Rules in the sandbox with sample data, to avoid any unexpected behavior.

Chargent provides a standard email receipt based on a Classic Email Template in Salesforce and a Workflow Rule. You can either modify the existing email template or create your own email with your own Workflow Rule.

Chargent includes a Workflow Rule called Customer Receipt, which is also the name of the Classic Email Template you can edit.

To enable Chargent Customer Receipts Workflow Rule from Salesforce:

  1. Click the gear icon gear icon and select Setup
  2. Under Process Automation select Workflow Rules
  3. Find the Workflow Rule called Customer Receipt
  4. Check that it is Active (if not, click the Activate button)
  5. Click on the Rule Name Customer Receipt
  6. Under Workflow Actions click the Description Customer Receipt.
  7. Click Edit to configure the ‘From’ and optional CC Email addresses
  8. Click Save.

To edit the Chargent Customer Receipt Email Template:

  1. Click the gear icon gear icon and select Setup
  2. Under Email select Classic Email Templates
  3. Find the email Customer Receipt and click Edit
  4. When you are done editing the email click Save

You can add whatever additional merge fields you want to the customer receipt.

Additional Workflow Rules & Email Triggers to help your subscription billing.

Renewal Notification
For annual subscriptions, sending a renewal reminder 30 days before hand is a best practice (as well as being a legal requirement in some areas). You can use the Next Transaction Date, which is automatically calculated by Chargent based on the various recurring field values, to drive this email alert 30 days prior.

Here is an example Workflow Rule that you can create to automatically send out renewal emails. You want to use a Time-Dependent Workflow Action based on the frequency to send the email.


Card Declined Notification

When a credit card is declined for a recurring subscription transaction, here is a handy way to send an email alert automatically to your customer. Create a Workflow Rule based on the following criteria for the Transaction record, and trigger it to send an Email Notification to your customer.

  • Transaction: Response Status = Declined
  • Transaction: Recurring = True

Note that due to a limitation of Salesforce email capabilities, if you have more than 1 custom object called Transaction, you may not be able to select the Chargent transaction record.


Also check out our Account Updater feature which can notify customers of credit cards that are about to expire or have already expired.

Track Field History

Salesforce's Track Field History feature provides a useful audit trail for reviewing or troubleshooting past changes. Changes to tracked fields are displayed in the History related list. You can track up to 20 fields per standard or custom object, and the data is retained for 18 months.

AppFrontier recommends that you enable history tracking on key fields on both the Chargent Order and Transaction for auditing purposes. This way you will be able to review when a field was updated, and its before and after values, should there be questions in the future.

chargent order

Enabling History Tracking

  1. Click the gear icon gear icon and choose Setup

  2. Select the Object Manager tab
  3. Select Chargent Order
  4. Click Fields & Relationships
  5. Click the Set History Tracking button

  6. setup

    Note that if you have not previously enabled history tracking, the button may say Enable History Tracking, and you will need to check a box to enable it on the following screen

  7. Select the fields you wish to track
  8. Click Save

  9. field history

You may also need to add the Field Tracking History to the Page Layout as a Related List.

  1. Click the gear icon and choose Setup
  2. Select the Object Manager tab
  3. Select the object you want to track fields (recommended fields on the Chargent Order are listed below).
  4. Click Page Layouts
  5. Click the Page Layout that you want to add Field Tracking History.
  6. Under Related Lists drag the Field Tracking History to the Page Layout.
  7. Click Save

The 20 fields you will want to track will depend on your organization and how you are using Chargent. If you are doing ACH instead of Credit Card transactions, for example, you will want to select the bank fields, and if you are not doing recurring transactions you may not wish to select those fields. You may also wish to track other standard or custom fields on an object that may be unrelated to Chargent, which will reduce the number of Chargent fields you can track.
Here are our starting recommendations for Chargent fields to track:

Chargent Order Object

  • Total
  • Charge Amount
  • Manual Charge
  • Billing First
  • Billing Last
  • Billing Address
  • Billing Email
  • Card Name
  • Card Number
  • Card Expiration Month
  • Card Expiration Year
  • Charge Date
  • Payment Frequency
  • Payment Method
  • Payment Status
  • Payment Start Date
  • Payment Stop

Transaction Object

  • Amount
  • Recurring
  • Type
  • Response Status

Note that most fields on the Transaction record should not be edited, and users may not have permissions to change fields depending on how you have configured Chargent.

Process Builder and Validation Rules

Please be very cautious if you use the Process Builder, Validation Rules or Required fields on your Chargent Orders with recurring billing. Validation rules can prevent the Chargent Order from saving properly after a transaction occurs, which prevents the Transaction from being properly saved to the parent Chargent Order.

Because Recurring transactions run in a batch you would see the errors in the Apex Jobs monitoring page in Salesforce, and in emails to the Chargent Admin Email Address as configured in the Chargent Settings Tab..

Certain validation rule problems can result in duplicate transactions, so please be sure to test any validation rules in Sandbox prior to deployment. Contact us for additional assistance.

Process Builder and Chargent

Automation Using Process Builder and Chargent

What is Process Builder?

Process Builder is a point-and-click Salesforce tool that lets you easily automate if/then business processes and see a graphical representation of your process as you build. Every process consists of a trigger, at least one criteria node, and at least one action.

Why Process Builder?

Many of the tasks you assign, the emails you send, and other record updates are vital parts of your standard processes. Instead of doing this repetitive work manually, you can configure processes to do it automatically. Process Builder helps you automate your business processes and gives you a graphical representation as you build it.

Process Builder Capabilities

What does Process Builder do?

Without writing code, Process Builder can be made to:

  • Update the current record
  • Update a related record in a lookup or master-detail relationship
  • Create new records automatically
  • Send email alerts
  • Post to Chatter
  • Submit a record for approval
  • Launch a flow
  • And More!

To learn more, check out the following resources:

Note: Process Builder’s capabilities continue to evolve so always check Salesforce Documentation.

Process Builder VS Workflow

Process Builder lets you automate more things, it includes more flexible actions compared with the corresponding workflow actions. The Create a Record process action, for example, lets you create any record instead of just tasks. The ‘Update Records’ process action (which corresponds with the field update workflow action) also lets you update any related record, while the field update workflow action lets you update only the record or its parent.

Process Builder includes brand new actions that aren’t available in Workflow—such as Post to Chatter and Submit for Approval.

Process Builder is the future

Salesforce is no longer enhancing Workflow. They still support your use of workflow rules and will continue to do so. But all new functionality for the workflow use case will come through Process Builder. If you want to use the newest and enhanced functionality, migrate your automation to Process Builder.

Considerations and Limits


  • Process execution cycle
  • Processes attempt to execute blind to other processes and procedures
  • Apex, validation rules, workflow, and others can all cause problems

To Learn More, Check out the following resources:

Governor Limits

  • Governor limit on Salesforce are not just for developers
  • Process Builder is subject to the limits
  • Always check Salesforce documentation for the current limitations

To Learn More, Check out the following resources:

Best Practices

Good design:

  • Plot your business logic on paper or on chart
  • Revise existing components if needed, something that worked last week may not work with new requirements you just received, and it may need to be brought into the scope of what you are working on.
  • Strive for simplification
  • Always avoid unnecessary recursion and infinite loops within logic

TIP: When you replace a workflow rule with a process, deactivate the workflow rule before you activate the process. Otherwise, you can get unexpected results, such as overwritten records or redundant email messages. This best practice also applies when you replace an Apex trigger with a process.

To Learn More, Check out the following resources:

Control Who Receives Flow and Process Error Emails

When a process or flow interview fails, a detailed error email is sent to the admin who last modified the process or flow. But perhaps that admin isn’t the best person to read and act on the details of what was executed and what went wrong. Instead, you can choose to send error emails to the Apex exception email recipients, which you specify and control in Setup.

To Learn More, Check out the following article:

Managing Many Processes

As a system’s dependencies grow, its complexity becomes harder to manage. It is often recommended using some percentage of time (usually 10% - 20%), reworking or refactoring existing processes.


  • Naming convention - Avoid unclear names
  • Combine, collapse - Try to group conditions when possible to have one process instead of many
  • Consistent design - Keep your design principles consistent
  • Collaborate - Find effective ways to communicate with your team

Troubleshooting Processes

Use the error messages that appear in the Process Builder and the emails you receive when a process fails to help solve problems that arise when you’re working with processes. When all else fails, look at the Apex debug logs for your processes.

The following is a common design problem that causes processes to fail:

  • The process references a field that hasn’t been set. For example, you reference [ChargentOrders__Transaction__c].Order.Opportunity in your process. If the Opportunity lookup field isn’t set on the Chargent Order, the process fails because it doesn’t know which Opportunity to reference.

  • The workaround for this issue depends on where the reference exists in the process.

    • If you reference it in filter conditions, add another filter condition that checks whether the lookup field is set. You can do the same workaround if it’s referenced in a formula, for example, [ChargentOrders__Transaction__c].ChargentOrders__Order__r.Opportunity__c Is null False.
    • Otherwise, consider making the field required.

To Learn More, Check out the following resources:

Chargent & Process Builder

Chargent is a flexible application that allows payment processing to become easily managed, but every organization has different needs and complexities in their design. With Salesforce providing organization with special features that can be enabled that are not common in every instance, tailoring an application to fit every process isn’t realistic. This is why Process Builder can help you fill those needs by automating actions that are unique to your organization.

Below we have included Process Recipes, see what scenarios aligns with your company needs:

Process Recipe #1 - Chargent Anywhere with Person Accounts Enabled

Person Accounts: Person accounts store information about individual people by combining certain account and contact fields into a single record. Is important to know that after Person Accounts is enabled in Salesforce, it can’t be disabled. If you haven’t enabled Person Accounts and are considering this option, we recommend that you read the following document from Salesforce before you decide:

Considerations for Using Person Accounts

Use Case: For Chargent Anywhere’s Payment Console to work properly with person accounts enabled, you will need to create an automation using Process Builder. This automation will update Person Account related contact’s Mailing Address with Person Account Billing Address when record is created.

Complexity Level: Beginner

Requirements: Chargent Anywhere Installed & Configured, Person Accounts Enabled

Step by Step Instructions:

  1. Go to setup
  2. In the Quick Find box type: Process Builder
  3. Click on Process Builder
  4. Click on New
    1. The following screen will appear, requires input. See image below for reference.

    2. properties

    3. After you are done with this screen, click Save.

  5. Choose Object and Specify when to start process. See image below for reference.

  6. object

    1. Click Save.

  7. Name and Define Criteria for this Action Group. See image below for reference.

  8. criteria

    1. Click Save.

  9. Add Action and Select Action Type: Update Records
  10. Give Action a Name
  11. Select Record Type: Record related to the Account
  12. Click on Drop Down and Type: Contact ID
  13. Select Contact ID
  14. Define Action. See image below for reference.

  15. action

    • Click Save.

  16. Activate Process.

  17. activate

Don’t forget to run Mass Update to update all Contacts Mailing Addresses. You can use tools like to update existing records.

Process Recipe #2 - Paid Amount to Related Object

Paid Amount: The total amount paid towards the full amount due.

Use Case: Chargent Orders has a field called Total Transactions that captures this amount but some companies want to see this amount on a related object to see at a glance how much has their customer paid towards the full amount. An example would be using this field to verify if the deposit has been paid toward a Reservation, this will allow the agent to continue with the booking process.

Complexity Level: Beginner

Requirements: 1 Custom Currency Field in the Opportunity object and Lookup Relationship to Opportunity Object. (if you are using Chargent Anywhere in Opportunity this relationship has been already created)

  • Object: Opportunity
  • Create New Field
    • Data Type: Currency
    • Field Label: Paid Amount
    • Length: 16
    • Decimal Places: 2
    • Default Value: 0

Important Information: This automation is to be used for one Chargent Order with One or Multiple Transactions, Multiple Chargent Orders Will break this automation. This is great for recurring billing and verifying if the initial deposit amount has been met.

Step by Step Instructions:

  1. Go to setupsetup
  2. In the Quick Find box type: Process Builder
  3. Click on Process Builder
  4. Click on New
    1. The following screen will appear, requires input. See image below for reference.

    2. properties

    3. After you are done with this screen, click Save.

  5. Choose Object and Specify when to start process. See image below for reference.

  6. object

    1. Click Save.

  7. Name and Define Criteria for this Action Group. See image below for reference.

  8. criteria

    1. Click Save.

  9. Add Action and Select Action Type: Update Records
  10. Give Action a Name
  11. Select Record Type: Record related to the Chargent Order
  12. Click on Drop Down and Type: Opportunity (or any other related object)
  13. Select Opportunity
  14. Define Action. See image below for reference.

  15. action name

    1. Click Save.

  16. Activate Process.

  17. activate
    chargent order

Process Recipe #3 - Most Recent Transaction Response

Most Recent Transaction (MRT): The most recent transaction related to opportunity.

Use Case: To allow Sales Agents to Immediately identify an Opportunity record with a payment issue. Also, they will be able to create actionable list views to easily find the Opportunities that need attention.

Complexity Level: Beginner

Requirements: 2 Custom Text Fields added to the Opportunity Object

  • MRT-Response Message
  • MRT-Response Status

Action Delay Trick: if you will like to delay automation for less that an Hour Create the following Custom Formula Field to use in the Automation

Note: This is not an exact science so delay may take less or a bit longer time but is the best workaround for short delays.

  • Object: Transaction
  • Create New Field
    • Data Type: Formula
    • Field Label: 55 minutes ago
    • Formula Return Type: Date/Time
    • Formula:

Now() - (55/1440)

Step by Step Instructions:

  1. Go to setup setup
  2. In the Quick Find box type: Process Builder
  3. Click on Process Builder
  4. Click on New
    1. The following screen will appear, requires input. See image below for reference.

    2. properties

    3. After you are done with this screen, click Save.

  5. Choose Object and Specify when to start process. See image below for reference.

  6. object

    1. Click Save.

  7. Name and Define Criteria for this Action Group. See image below for reference.

  8. criteria

    1. Click Save.

  9. Under Scheduled Action Set Time for Action to Execute, See image for reference.

  10. time

    1. Click Save.

  11. Add Action and Select Action Type: Update Records
  12. Give Action a Name
  13. Select Record Type: Record related to the Transaction
  14. Click on the Drop Down and Type: Order
  15. Select Order >
  16. On the Second Drop Down Type: Opportunity
  17. Select Opportunity
  18. Define Action. See image below for reference

  19. action

    1. Click Save.

  20. Activate Process

  21. activate