Use the Apex WaveTemplateConfigurationModifier Class

The WaveTemplateConfigurationModifier class checks an org’s data. Also, to simplify app creation, it can modify the template configuration wizard accordingly.

Apex is the object-oriented Salesforce programming language that allows developers to execute flow and transaction control statements on the Lightning Platform server along with calls to the API.

Using WaveTemplateConfigurationModifier in a smart wizard simplifies standard app creation in these ways:

  • Checks if the org has data required to create the app.
  • Checks if security settings enable app creation. For example, it determines if the Analytics Integration User has access to all fields required to create the app.
  • Checks the org’s fiscal year start date. Based on the outcome, the wizard can use a default setting, such as January 1, or require the user to choose a fiscal year start date for use in the app.
  • Hides or exposes a wizard question (variable) based on the org data. For example, say that your wizard includes a question about opportunities. The smart wizard can check an org for the Opportunity object and, if it detects use of the object., display the question.
  • Sets the values included in a wizard question’s answer field. The smart wizard can include or exclude specific fields and expand or limit the number of values displayed.

The WaveTemplateConfigurationModifier can also be used with embedded apps to check the org’s data and security settings. In this use case, you can fail app creation with a clear message for the Auto-Install request. You can also set template variables based on org settings to be used in app creation.

Declare the class in template-info.json.

If you implement the modifier and unit test classes in your Visual Studio project, include your classes in the classes directory along with the class metadata files.

For complete details about Apex, see Apex Developer Guide.