Customize Dynamics 365 for Marketing

Applies to Dynamics 365 (online), version 9.x

Customize Dynamics 365

Dynamics 365 for Marketing is built on the standard Dynamics 365 infrastructure, which provides rich possibilities for customization without coding. Customizers can add new fields to existing entities, add or hide fields in list or form views, design custom business processes and workflows, and much more—all while working in their web browser. Other types of customization include installing custom solutions from Microsoft AppSource, such as a third-party SMS solution for Marketing. The system also provides APIs that enable developers to write code that implements even more advanced custom functionality and third-party integration.

The techniques for customizing the Marketing application are like those for customizing other Dynamics 365 Customer Engagement applications—especially Dynamics 365 for Sales. You can make many of the most common types of customizations while working directly in the Settings work area of Dynamics 365 for Marketing, but even more types of customization settings are available in the Dynamics 365 - custom app.

The Dynamics 365 - custom app is included with Dynamics 365 for Marketing. It combines features from many of the various Dynamics 365 apps you have licensed into a single navigation structure (but most Dynamics 365 for Marketing end-user features aren’t included here). The custom app operates on the same database as Dynamics 365 for Marketing, so settings made in the custom app (including for customization, user administration, events, LinkedIn Lead Gen, Voice of the Customer, and more) can affect the Marketing app.

To go to the customization settings in Dynamics 365 for Marketing, go to the Settings work area, choose Advanced Settings, and then work in the Customization section, where you can edit views and business and process flows. To go to the custom app, which provides access to these customization settings and more, choose Dynamics 365 - custom from the app-selector menu, and then go to Settings > Customization. The following image shows how to use the app-selector menu to switch between the Marketing and custom apps.

The app-selector menu

For complete details about how to customize Dynamics 365, see the Customization Guide for Dynamics 365 Customer Engagement. That guide describes the interface as you see it in the Dynamics 365 - custom app, but the customization features that are also provided in the Settings work area of Dynamics 365 for Marketing implement similar concepts, operate on the same database, and work similarly. For details about customizations that apply only to the Marketing app (but not other Dynamics 365 apps), see the other sections in this topic.

For more information about writing code and developing for Dynamics 365, see the Developer Guide for Dynamics 365 Customer Engagement.

Add custom validation rules

A standard feature of Dynamics 365 for Marketing is its ability to check published content for errors before going live. You've probably seen this feature at work when designing email messages, customer journeys, forms, lead-scoring models, and other features that use the content designer interface. The validation (Check for Errors) feature works by checking for missing content (such as a required setting or a subscription-center link in a marketing email) and errors (such as illogical settings, syntax errors, or messages that won't compile). After the error check, Dynamics 365 for Marketing displays the results right on the page, including error messages that should help the user solve the issue.

The check-for-errors button and notifications

The validation feature works by implementing a validation pipeline with a series of rules that the content must pass. For each violation, an error or warning is added to the response and the content won't be allowed to go live. Customizers can extend the pipeline by adding a custom validation stage that implements the required custom checks. You might use this capability to, for example, scrub email text for obscenities or to ensure that a required disclaimer is always present. Custom validation rules require custom coding to create the actual validation logic. Your code must parse the incoming text and generate messages as needed.

Add a custom action to a validation pipeline

Here's an example for how to add a custom validation step to a pipeline.

  1. Each custom action must accept the results of the previous validation action from the ValidationContext, and set the cumulative results to the ValidationResults output variable. In the following screenshot, ValidationPipeline is the envelope custom action, which holds the entire pipeline. The child actions are similar, using the same interface, outputs, and registration.
    Validation pipeline actions

    Note that after adding a new validation step to the pipeline, you must update the SetResult step of the ValidationPipeline action to take results from the previously called custom action—in the previous step, this is Validator2.

  2. Arrange the stages in the validation pipeline as indicated in the following screenshot.
    Validation pipeline stages

  3. Set up the Validator1 step as follows:
    The Validator1 step

  4. Set up the Validator2 step as follows:
    The Validator2 step

  5. Set up the SetResult step as follows:
    The SetResult step

  6. Set the custom action for Validator1 as follows:
    Custom action for Validator1

  7. Set the plugin step for Validator1 as follows:
    Plugin step for Validator1

  8. Set the custom action for Validator2 as follows:
    Custom action for Validator2

  9. Set the plugin step for Validator2 as follows:
    Plugin step for Validator2

Test the customized validation pipeline

To test your validation pipeline, do the following:

  1. Open a Google Chrome console, and then execute the following code:
    $.ajax({type:"POST", url:"", data: JSON.stringify({ValidationContext: "val-ctx"}), contentType:"application/json", dataType:"json"})
    Google Chrome console

  2. The results will be visible on the Network tab.
    Google Chrome Network tab