You can configure your Connector for Salesforce Sync to end date billing entities associated with a m3ter Account:
Account Plan
Prepayment/Commitment
Contract
Pricing
Counter Pricing
The capability to collectively end date billing entities associated with an end-customer Account is very useful in cases where you need to create new agreements with end-customers - such as for renewals or mid-service term amendments - and for service cancellations
Once you have the m3ter Connector for Salesforce managed package installed and configured for syncing with your m3ter Organization, you can end date Account billing entities directly and quickly through your Salesforce Org user interface using a simple set up form with submit button. Alternatively, you can trigger end dating for Account billing entities with an Invocable Action.
This topic explains how to set up and work with the end dating Account billing entities feature available in your m3ter Connector managed package, and provides essential reference information on its details, design, and operational constraints:
Note Alternative! End Dating Account Billing Entities via Contract. You can also perform a sync to end date m3ter Account billing entities using a Contract. This topic explains how to do this with your installed Salesforce m3ter Connector using an Account, but the details apply similarly if instead you want to do this via a Contract data object or other data object in your Salesforce Org which is synced to a Contract linked to an Account in your m3ter Organization.
Important!
Check Version. The end date Account billing entities feature is only available in version 0.5 and above of the m3ter Connector for Salesforce managed package. See m3ter Connector for Salesforce - Changelog for details on how to check your current installed version.
In your Salesforce Org when you've set up the m3ter Connector for syncing Salesforce data objects with corresponding entities in your m3ter Organization, you can quickly set up and submit a sync for end dating the billing entities associated with an Account or Contract using the End Date m3ter Billing Data action.
To end date Account billing entities:
1. In your Salesforce Org under Page Layouts, use the Mobile and Lightning Actions list to add the End Data m3ter Billing Data button to the page where you want it to reside.
Tip: More Details? For more details, see the steps documented for Adding m3ter Sync Action for Sales Object.
2. On the page, select the End Date m3ter Billing Data button. The set up form opens for the selected Account:
3. Use the End Date calendar icon to open and select the end date you want to apply to the Account billing entities.
4. Under Select Billing Entities, select each of the entities linked to the Account you want to end date in the Available box and use the arrow to transfer them to the Selected box:
Note that the Submit to m3ter button is now activated.
5. If the selected Account is a parent Account and you want to apply end dating to the selected billing entities linked to the Account's child Accounts in your m3ter Organization, select the Apply to Child Accounts checkbox.
6. Select Submit to m3ter. The end dating sync action is performed:
If the action is successful, you'll receive a confirmation message with details of the Account billing entities that were updated accordingly in your m3ter Organization:
If the action fails, you'll see an error message:
Alternatively, you can perform a sync from your Salesforce Org using the m3ter Connector managed package to end date Account billing entities by triggering an Invocable Action (IA).
Important: Review details of Sync to m3ter IA! If you are planning to end date Account billing entities using the IA method, please review the earlier topic in this section for Setting Up and Using Sync to m3ter Invocable Action. The end dating IA set up and operational constraints are similar and the following section assumes you have reviewed and understood the details for using the Sync to m3ter IA.
There are two ways you can implement the sync for end dating Account billing entities IA feature in your managed package:
Flow
APEX
You must perform three configuration tasks to ensure that the Action performs as expected when using Record Triggered Flows:
1. To enable Run Asynchronously, you must select the checkbox for:
Include a Run Asynchronously path to access an external system after the original transaction for the triggering record is successfully committed.
2. In the options for When to Run the Flow for Updated Records, you must select:
Only when a record is updated to meet the condition requirements.
3. You must add the Action to the Run Asynchronously path.
Tip: More Details for Flow? These settings are analogous to what is required when setting up the Sync to m3ter Invocable Action. See under Flow in the for Implementing Sync to m3ter IA section for a helpful example and more details.
Here is a sample Apex Code to invoke the end dating feature.
Importantly, note that you must check and alter for the correct namespace and depending on the environment:
1List<m3tertest.EndDateM3terEntitiesInvocable.M3terEndDateSyncRequest> requests;2List<m3tertest.EndDateM3terEntitiesInvocable.M3terEndDateSyncResult> results;34System.debug('Testing Valid Record');5requests = new List<m3tertest.EndDateM3terEntitiesInvocable.M3terEndDateSyncRequest>{6new m3tertest.EndDateM3terEntitiesInvocable.M3terEndDateSyncRequest()7};8requests[0].recordId = '006Pu00000G88gkIAB';9requests[0].endDate = '2024-12-30T00:00:00Z';10requests[0].applyToChildRecords = false;11requests[0].billingEntities = new List<String>{'CONTRACT'};1213results = m3tertest.EndDateM3terEntitiesInvocable.endDateM3terEntities(requests);14if (!results.isEmpty()) {15m3tertest.EndDateM3terEntitiesInvocable.M3terEndDateSyncResult result = results[0];16System.debug('=== Result Details ===');17System.debug('Success: ' + result.success);18System.debug('Message: ' + result.message);19System.debug('Response: ' + result.response);20System.debug('====================\n');21}
USER_DEBUG|[16]|DEBUG|=== Result Details ===
USER_DEBUG|[17]|DEBUG|Success: true
USER_DEBUG|[18]|DEBUG|Message: Billing entities successfully updated.
Updated entity types: CONTRACT
USER_DEBUG|[19]|DEBUG|Response: {"statusMessage":"Billing entities successfully updated.","updatedEntities":{"CONTRACT":["3a270ffe-1ad3-47d8-bc29-dd4891b1e296"]}}
USER_DEBUG|[20]|DEBUG|====================
This section provides important reference information if you choose to implement the end date Account billing entities feature.
Field Name | Purpose |
---|---|
INPUT | |
Record ID (string - required) | The Salesforce Id of the m3ter record to end date. Accounts or Contracts can be end dated. |
End Date (string - required) | The date to end date the record. Format: ISO 8601, that is: YYYY-MM-DDTHH:MM:SSZ |
Apply to Child Records (boolean- required) | If true, the end date will be applied to all child records. Default is false. |
Billing entities (list <strings> - required) | The billing entities to end date. Valid values are: CONTRACT, ACCOUNTPLAN, PREPAYMENT, PRICINGS, COUNTER_PRICINGS. |
OUTPUT | |
Success (boolean) | Boolean indicating whether or not the entire sync process was successful: True if result is success; False if result is false. |
Message (string) | The overall status of the process. |
Result (string) | Detailed message about the result. |
Some operational safeguards and design constraints are built into the end dating feature. Please review this section before implementing and running the feature.
To ensure predictable behavior and prevent resource exhaustion:
The action is explicitly designed to process only one record at a time.
Multiple record requests will result in a Failed status with appropriate error message.
Validation checks:
Performs existence check on the parent record before initiating sync.
Returns specific error statuses for:
Invalid/null record IDs
Non-existent records
Record access issues
Invalid End Date format
Invalid Billing Entities
Two status codes are given:
Success: All objects synced successful.
Failed: System-level failures (CPU limits, validation errors, and so on).
Given the action will perform a number of API callouts to m3ter, you must ensure that it is called from a separate transaction to avoid provoking the following error:
"You have uncommitted work pending. Please commit or rollback before calling out"
This is a common Salesforce error related to transaction management and external callouts:
Flows: If the action is not set to run asynchronously, and there are any DML operations before it in the flow, you will encounter this error.
Apex: If you try to call the action directly after performing DML operations in the same transaction, you will get this error.
To avoid this error:
Flows: Always use the "Run Asynchronously" option for the Sync to m3ter action.
Apex: Use the @future(callout=true)
method. This ensures the callout happens in a separate transaction.
Login to the Support portal for additional help and to send questions to our Support team.