Customizing Chargent Anywhere #
Chargent Anywhere can be customized to help automate your billing process. Here are a few things that can be configured through the Page setup.
Default Gateway: This is particularly useful if you have different page layouts assign to different profiles. You can easily assign a different payment gateway based on the page layout for each user.
Default Charge Amount: When using the Payment Console you can set the default ‘charge amount’ to be automatically populated based on a specific field within your page.
Default Recurring Amount: When using the Payment Console you can set the default ‘recurring charge’ amount to automatically populate based on a specific field within your page.


Button Visibility: You can add and remove specific buttons from the page so that your users only see the buttons they need to see.
Billing Account Lookup: Automatically populate the Payment Console with the correct account information.
Billing Contact Lookup: You can select a specific contact to populate their billing information based on the associated account.
Charge Button Text: You can control what the Charge button says.

For full documentation on customizing your Chargent Anywhere experience, see our Chargent Anywhere Quick Start Guide.
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.
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:
- Click the gear icon
and select Setup
- Under Process Automation select Workflow Rules
- Find the Workflow Rule called Customer Receipt
- Check that it is Active (if not, click the Activate button)
- Click on the Rule Name Customer Receipt
- Under Workflow Actions click the Description Customer Receipt.
- Click [Edit] to configure the ‘From’ and optional CC Email addresses
- Click [Sav].
To edit the Chargent Customer Receipt Email Template:
- Click the gear icon
and select Setup
- Under Email select Classic Email Templates
- Find the email Customer Receipt and click [Edit]
- 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.
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.
Connecting Chargent Orders to other Objects
Chargent Orders is a separate object from Salesforce standard objects. When you set up Chargent Anywhere on a native Salesforce object you should also relate that object to the Chargent Order (which hosts the current payment information). You can add this as a Related item, however you need to first create Lookup fields to connect the two.
For example, you install Chargent Anywhere on your Opportunity object and now want to relate the Chargent Order payment source as a Related item. Simply create a Lookup field on the Opportunity object and then add it to the Page Layout.
Instructions from the Chargent Orders with Opportunities Guide can be followed to relate Chargent Orders to other standard or custom objects in Salesforce.
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:
- Documentation – Lightning Process Builder
- Trailhead – Quick Start: Process Builder
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.
To learn more, check out the following resources:
- Trailhead – Workflow Rule Migration.
Considerations and Limits
Considerations:
- 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 lore, 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:
Control Who Receives Flow and Process Error Emails
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.
Tips:
- 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: Troubleshoot Processes
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 are 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:
- Go to Setup
- In the Quick Find box type: Process Builder
- Click on Process Builder
- Click on New
- The following screen will appear, requires input. See image below for reference.

- After you are done with this screen, click Save.
- Choose Object and Specify when to start the process. See image below for reference.

- Click [Save].
- Name and Define Criteria for this Action Group. See image below for reference.

- Click [Save].
- Add Action and Select Action Type: Update Records
- Give Action a Name
- Select Record Type: Record related to the Account
- Click on Drop Down and Type: Contact ID
- Select Contact ID
- Define Action. See image below for reference.

- Click [Save].
- Activate Process.


Don’t forget to run Mass Update to update all Contacts Mailing Addresses. You can use tools like Dataloader.io 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:
- Go to [Setup]
- In the Quick Find box type: Process Builder
- Click on Process Builder
- Click on [New]
The following screen will appear, requiring input. See image below for reference.

After you are done with this screen, click Save.
- Choose Object and Specify when to start the process. See image below for reference.

- Click [Save].
- Name and Define Criteria for this Action Group. See image below for reference.

- Click [Save].
- Add Action and Select Action Type: Update Records
- Give Action a Name
- Select Record Type: Record related to the Chargent Order
- Click on Drop Down and Type: Opportunity (or any other related object)
- Select Opportunity
- Define Action. See image below for reference.

Click Save.
- Activate Process.


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 would 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:
- Click the gear icon and choose Setup
- In the Quick Find search and select: Process Builder
- Click on [New]
The following screen will appear, requiring input. See image below for reference.

- Click [Save].
- Choose Object and Specify when to start the process. See image below for reference.

- Click [Save].
- Name and Define Criteria for this Action Group. See image below for reference.

- Click [Save].
- Under Scheduled Action Set Time for Action to Execute, See image for reference.

- Click [Save].
- Add Action and Select Action Type: Update Records
- Give Action a Name
- Select Record Type: Record related to the Transaction
- Click on the Drop Down and Type: Order
- Select Order
- On the Second Drop Down Type: Opportunity
- Select Opportunity
- Define Action. See image below for reference

- Click [Save].
- [Activate] Process

