Skip to main content

Example

What you'll build

This example builds an integration that connects to Microsoft Dynamics 365 Finance Receivable and retrieves the advance line records configured for accounts receivable. The automation runs on demand, lists the available advance lines, and logs the result as a JSON string so you can inspect the response.

Operations used:

  • List Adv Lines : Retrieves the collection of advance line records from the Microsoft Dynamics 365 Finance and Operations environment.

Architecture

Prerequisites

  • A Microsoft Dynamics 365 Finance and Operations environment, cloud-hosted or sandbox.

  • An Azure Active Directory (Entra ID) app registration with API permissions for Dynamics 365, including a client ID, a client secret, and a token URL.

  • The application must be registered as a user in the target Dynamics 365 Finance and Operations environment and assigned the security roles required for this connector's operations.

Setting up the Microsoft Dynamics 365 Finance Receivable integration

New to WSO2 Integrator? Follow the Create a New Integration guide to set up your integration first, then return here to add the connector.

Adding the Microsoft Dynamics 365 Finance Receivable connector

Step 1: Open the connector palette

Select Add Connection in the Connections section.

Microsoft Dynamics 365 Finance Receivable connector palette open before selection

Step 2: Select the Microsoft Dynamics 365 Finance Receivable connector

  1. Enter microsoft.dynamics365.finance.receivable in the search field.
  2. Select the Receivable connector card.

Configuring the Microsoft Dynamics 365 Finance Receivable connection

Step 3: Bind the connection parameters to configurable variables

Switch Config to expression mode and bind its nested fields to configurable variables. Bind Service Url to a configurable variable through its helper panel.

  • Config : The authentication settings used to initialize the connector, bound to tokenUrl, clientId, and clientSecret configurable variables. Enter the expression {auth: {tokenUrl, clientId, clientSecret, scopes}}.
  • Service Url : The base URL of the target Microsoft Dynamics 365 Finance and Operations environment, bound to a configurable variable. Use the OData root, for example https://<your-org>.operations.dynamics.com/data.

Microsoft Dynamics 365 Finance Receivable connection form with all parameters bound before saving

Step 4: Save the connection

Select Save Connection and verify that the connection appears in the Connections section.

Microsoft Dynamics 365 Finance Receivable connection visible after saving

Step 5: Set actual values for your configurables

  1. Select Configurations at the bottom of the project tree under Data Mappers.
  2. Enter a value for each configurable listed below before you run the integration.
  • tokenUrl (string) : The OAuth2 token endpoint URL used to obtain an access token.
  • clientId (string) : The application (client) ID from the Azure AD app registration.
  • clientSecret (string) : The client secret from the Azure AD app registration.
  • scopes (string[]) : The OAuth2 scope requested for the client-credentials token, set to the environment base URL followed by /.default
  • serviceUrl (string) : The base URL of the target Microsoft Dynamics 365 Finance and Operations environment.

Configuring the Microsoft Dynamics 365 Finance Receivable List Adv Lines operation

Step 6: Add an automation entry point

  1. Select Add Entry Point next to Entry Points.
  2. Select Automation.
  3. Select Create to accept the settings.

Step 7: Expand the connection and configure the List Adv Lines operation

  1. Select the + icon on the automation flow.
  2. Expand receivableClient to display its operations.

Microsoft Dynamics 365 Finance Receivable connection expanded to display operations before selection

  1. Select List Adv Lines. This operation has no required parameters, so the default result variable name is sufficient.

Microsoft Dynamics 365 Finance Receivable List Adv Lines operation with all values entered before saving

  1. Select Save.

Step 8: Log the List Adv Lines result

Add a Log Info action, switch its Msg field to expression mode, and enter receivableAdvlinescollection.toJsonString() to log the result. Return to the visual flow to confirm the complete chain from Start to List Adv Lines to the log step to Error Handler.

Completed Microsoft Dynamics 365 Finance Receivable flow with the configured operation

Try it yourself

Try this sample in WSO2 Integration Platform.

Deploy to Devant

View source on GitHub

More code examples

The Dynamics 365 Finance Ballerina connectors provide practical examples illustrating usage in various scenarios. Explore these examples.