Using the Button Messaging Activation Method
You can use the button activation method to enable you to trigger messaging manually using a button on a list view or record page.
If you have upgraded to Summer 2022, you must update the Activation Method field on the Publication object to include a new picklist value of "Button". For more information about adding new picklist values, see the Salesforce Help.
This section describes how to set up this option for use in your production org:
- In your sandbox, create a basic messaging relationship that contains at least one mapping. The details of the relationship are not important and are only required to generate the relevant classes.
For more information, see Creating a Messaging Relationship. - Activate your relationship using the button activation method. For more information, see Activating a Messaging Relationship. This generates the relevant Apex classes that enable you to use this activation method in a production org.
- Transfer the relevant Apex classes from your sandbox to your production org. We recommend using Salesforce change sets.
- From setup, create a new change set that includes the following Apex classes:
- UnmanagedMessagingButtonController
- UnmanagedMessagingButtonControllerTest
- Upload the outbound change set.
- In your production org, identify the inbound change set and deploy it.
For detailed information about using change sets, see the Salesforce Help. - From setup, create a new change set that includes the following Apex classes:
- In your production org, create the messaging relationships that you want to activate with the button activation method. For more information, see Creating a Messaging Relationship and Adding Mappings to a Messaging Relationship.
- When you are ready to activate messaging in production, activate each relationship using the button activation method. For more information, see Activating a Messaging Relationship.