Create custom actions and place them either on the Detail Page, Activity Timeline or right on the Card. There are different types of App Actions:
- System. Pre-existing ones like Edit or Delete Records.
- Automation. On App Action click, trigger your automation.
- Custom Code. Create your own flow.
- Mobile.
User Permissions: Only Administrators can create App Actions.
Prerequisites: For the Automation type, the desired Automation has to be created before adding a new App Action.
In this tutorial, we will cover the following topics:
- Navigate to App Actions
- Create App Action
- Automations
- Custom Code App Actions
- Custom Code Examples
- Form Rules for App Actions
Navigate to App Actions
Open the menu and go to 'Admin Settings' to display the available options, then select your desired app and click on the 'App Actions' tab. You can also use the search function to get there faster, just start typing 'App Actions'.
Create App Action
Click on the 'Create App Action' button to get started.
There are a few elements to take into consideration when creating a new App Action, you can see the details for each of them below:
1. Name
Identifies the App Action.
2. Action Hint
This can be identical to the name of the action or you can provide more detail on what that action does. If you use this action as a button this text will act as the mouse over text.
3. Icon
You can search for an icon to add to your action to help identify it.
4. Appearance
You have three options
Default - Light grey colored button.
Primary - The button will have the main color of the selected theme.
Secondary - Light grey colored button.
5. Placement
List - Add the action to the options menu within the list view.
Timeline - Adds it to the Actions button.
Detail Page - The buttons will show up on the top right corner of the detail page of any record.
Event Log Card
Mobile - Enables the App Action on the mobile App.
Notification Card -
Related - This is the related list that shows in the detailed view of any record within an app. In this example, I've created an Action in the 'Contacts" app and it shows up in the related list options menu of any other app where Contacts are referenced.
6. Roles
Select the Roles that will have access to the App Action
7. Type
Automation
It will allow you to select from any of the existing automations in the field available above.
If the type is 'Automation' here you will need to select the automation that will be triggered when the App Action button is clicked on.
Bulk
This type of action requires some custom code.
You're given two text boxes. The first is to add in the condition for the action and the second is for the action itself. Below is an example that allows the user to merge two records.
Custom Code
For more complex actions that might involve 3rd party apps. Here is where you can add the code for your App Action. From simple status changes to more complex integrations with 3rd party apps.
Dropdown
Overflow
This type is useful if you'd like to create a menu with multiple options. In this example, a menu was created within the detail page of the Sales app. The Child App Actions are the menu options.
This is what it looks like in action.
Set Fields
This is a great way to add a button that performs multiple tasks without having to create any code. Let's take a look at an example. We're going to create a button that will allow team members to close a sale with one button click.
After choosing the action name and appearance it's important to decide where this button will be placed. In this case, it will be on the detail page of the record as well as the list view menu. Feel free to add an icon if you'd like the button to stand out a little.
Now we need to create our conditions. In this case, the button will not appear if the sale is already won or lost.
Lastly, we need to set our fields. These are the actions that will take place behind the scenes when the button is clicked. In this case, the sale will be marked as 'Closed Won', the close date will be the date it was clicked, the win probability will be 100%, and the 'Forecast Category' will be closed.
System
For existing App Actions like Edit or Delete.
Widget
Once you've saved your App Action it will be available in the App Actions tab.
Edit App Action
Select the App Action to modify and click the 'Edit' button. Make your changes and save once you are done.
Deactivate / Activate App Action
Select the App Action that you want to stop using and click the 'Deactivate' button. To start using it again, click the 'Show deactivated' checkbox to show all App Actions, select it and click the 'Activate' button.
Reorder App Actions
You can change the order in which the buttons appear on the detail page, just click the 'Reorder' button and drag and drop your App Actions in the desired order. Then just save your changes.
Automations
In order for the App Actions to do something, it is necessary to create an Automation for them. There are different types of Automations available, from the creation of new records or tasks to more elaborated ones, like those based on Custom Code. To learn more about Automations and how to create them, please visit the following tutorial:
Automations
Custom Code App Actions
FreeAgent CRM allows you to easily set up powerful App Actions via custom code. When creating a new App Action select 'Custom Code' or 'Bulk' within the Type field to enable the custom code window below:
This code will now be editable and with a few simple modifications, you can create a robust App Action. Through this feature, you will empower your team to achieve seemingly complex flows with the simple click of a button.
Custom Code Examples
Let's use custom code to set up an App Action. For this example, we will be setting up an 'Add Contact' button within the Accounts app which will appear on the detail page of any given account.
From here your team will be able to quickly create a new contact directly from the Accounts app.
To get started, navigate to the App Actions page of your Accounts app. Click on 'Add New App Action.' Set the Required Fields as shown below:
Note that the 'Placement' field must have one selection, in this case, the 'Detail Page,' but multiple placements for the App Action button can be selected.
Now it's time to input the custom code to enable the App Action. In the 'Custom Code' field that is now editable, enter the following code and click 'Save.' You've just created an 'Add Contact' App Action.
(function(record, context){
const accountId = record.id;
const accountFields = record.field_values;
const accountIndustry = accountFields.industry_catalog_id;
const accountName = accountFields.name;
context.clientAPI.showModal('entityFormModal', {
entity: 'contact',
initialValues: {
first_name: `${accountName.value} Contact`,
industry_id: { id: accountIndustry.value, name: accountIndustry.display_value },
logo_id: { id: accountId, name: accountName.value },
}
});
}(record, context));
This code can be formatted and applied to different use cases, refer to this table:
Code Segment |
Function |
entity: 'contact', | 'contact,' will specify the App function of the button. See below for example |
first_name: `${accountName.value} Contact`, |
For non-dropdown fields, directly set values like this |
industry_id: { id: accountIndustry.value, name: accountIndustry.display_value }, | For dropdown fields specify ID and name like this |
Modifying the following code segment will allow you to choose the App functionality of your button:
entity: 'contact',
For instance, let's create a 'New Quote' button within the Opportunity App. The process will be similar, create an App Action within the Opportunity App. Name the App Action 'New Quote' and choose your desired placement(s).
You will use the base custom from the previous example, with a few changes. Refer to the above table to set your desired field configurations and make this code change:
entity: 'quote',
Click 'Save' and now you will have a custom App Action button to create a New Quote from a given Opportunity.
Refer to our most popular use case to see a sample of custom code and how to modify the parameters: Publish Via PDF Template
Form Rules for App Actions
You can create a set of conditions for App Actions. If those conditions are not met, then it doesn't matter how many times you click the App Action button, nothing is going to happen. To learn more about them, please visit the following tutorial:
Form Rules