You can configure your Connector for Salesforce Sync to end date billing entities associated with a m3ter Account:Documentation Index
Fetch the complete documentation index at: https://docs.m3ter.com/llms.txt
Use this file to discover all available pages before exploring further.
- Account Plan
- Prepayment/Commitment
- Contract
- Pricing
- Counter Pricing
End Dating Using Set Up and Submit Form in UI
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:- In your Salesforce Org under Page Layouts, use the Mobile and Lightning Actions list to add the End Date m3ter Billing Data button to the page where you want it to reside.
- On the page, select the End Date m3ter Billing Data button. The set up form opens for the selected Account:

- Use the End Date calendar icon to open and select the end date you want to apply to the Account billing entities.
- 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.
- 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.
- 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:

End Dating Using Invocable Action
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). There are two ways you can implement the sync for end dating Account billing entities IA feature in your managed package:- Flow
- APEX
Flow
You must perform three configuration tasks to ensure that the Action performs as expected when using Record Triggered Flows:- 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.
- 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.
- You must add the Action to the Run Asynchronously path.
Apex
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:
Sample Output
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|====================
Reviewing Feature Details
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. |
Reviewing Guardrails and Limits
Some operational safeguards and design constraints are built into the end dating feature. Please review this section before implementing and running the feature.Single Record Processing
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.
Record Validation
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
Status Codes and Messages
Two status codes are given:- Success: All objects synced successful.
- Failed: System-level failures (CPU limits, validation errors, and so on).
Enforcing Asynchronous Processing
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”
- 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.
- 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.