ConditionalButton Button Class
The ConditionalButton button class shows or hides a button based on the results of a data source. When the record ID of the button is in the data source results, the button is displayed. This requires the button to have an associated record ID (like in a list of records) and a data source.
How Can I Use It?
The ConditionalButton button class is useful in cases where you want to give constituents the ability to edit only certain records in a list. For those records in the list they should be able to edit, a button displays which they can click to edit the record. For those records in the list they should not be able to edit, well, "no button for you".
Example: You can use this button class on a button added to a card listing the volunteers in your association. constituents who volunteer can view the list of all volunteers in the association, and for those who work in the volunteer group they lead, they can click Edit to add or change their logged service hours.
When using this button class on a button with a data source using a SOQL Query record, keep in mind the SOQL Query will return up to 50,000 records. To ensure you are not exceeding this limit, be sure to use different data sources for the card and button, and set some criteria in the SOQL Query clause of the SOQL Query record for both.
Additionally, when working with a card that displays a list of records, we recommend using a more refined WHERE clause on the button data source query than is used for the card data source query. This ensures buttons are shown on a subset of all records returned and the limit of 50,000 is not exceeded.