Custom Actions

Custom Actions also known as invocable methods provide a friendly way of calling the functionality of an API via a user interface.

Each FinancialForce custom action resides within an Apex class. It is the Apex class which calls an API method. You can use these actions in Process Builder to call an API method to execute Apex code. Process Builder allows you to create such functionality as advanced workflow rules.

These Apex classes can be used in Process Builder.

Apex Class Purpose API Method
ActionCPFTAccounts Creates new projects, based upon supplied template projects, attached to given accounts. CreateProjectFromTemplateService.createProjectsFromTemplatesAndAccounts
ActionCPFTOpportunities Creates new projects, based upon supplied template projects, attached to given opportunities. CreateProjectFromTemplateService.createProjectsFromTemplatesAndOpportunities

The process is run as the user who triggered it when using Custom Actions with Process Builder. Therefore, if ActionCPFTOpportunities is fired at the end of a Process Builder flow, for example, triggered when an Opportunity’s Stage is changed to ‘Closed - Won’, the user performing the action needs a PSA license and the appropriate PSA Permission Controls. For instance, the Staffing permission control is required when the template project contains Resource Requests. This enables this user to create the Project and appropriate child objects upon it.

See the PSA API Developer's Reference for further information about our Apex classes. For more information, see FinancialForce PSA Documentation in Community. For more information about using custom actions, see the documentation for the Salesforce Process Builder.

Invocable Methods for use with the Billing Events Integration

When the Billing Events Integration is enabled in your org, the following custom actions can be used to automatically create billing documents for valid billing events.

Apex Class Purpose API Method
BillingDocServiceActionCreateBDAsync Asynchronously creates billing documents when given valid billing event IDs. This method should not be used if it might be triggered from a batch execution, or other contexts where starting a batch job won't work. createBillingDocumentAsync
BillingDocServiceActionCreateBDSync Synchronously creates billing documents when given valid billing event IDs. createBillingDocumentSync

A billing event is only eligible for billing document creation if:

You could set up a filter in your process to filter on these criteria.

Note:

To avoid the risk of the process builder executing multiple times, you might also want to filter out billing events where the Billing Document Creation Status is not empty. If a billing event's Billing Document Creation Status is "Error", take action to resolve the error then use the Create Billing Document button on the billing event's detail page to create a billing document for that specific event.