Integrate a knowledgebase with Microsoft Dynamics to send real-time, event-driven updates between the systems. This integration uses an external system adapter (ESA) to sync and Microsoft Dynamics.
You might also want to reference an Example Microsoft Dynamics Setup as you work on configuring your own sync.
This information is provided for those who have already configured a sync with Dynamics using this configuration. For new integrations with Microsoft Dynamics, use the Integration Hub for best results. |
First, prepare Dynamics for the integration:
In the App Designer, create or identify an entity for each table you want to sync. For example, if you want to sync contracts and contract-related data, you likely need the following entities and fields in Dynamics:
Make sure every entity you plan to sync includes a Text field with a name similar to "Identifier for Sync," even if the entity already exists. Make sure the field is not visible on any forms, and users can't modify it.
The Identifier fields are Text fields used later to match records with during synchronization. You can give these fields any name, as long as it will be clear to you during setup, such as "Identifier for Sync" or "ID for ." Configure the field so it isn't visible on any forms, and the user can't modify it. If Dynamics does not allow you to create a new field in the Notes entity, use the existing Step Id field as an alternative. |
From these steps, you should have these essential pieces before you move on to the next section:
https://<YOUR_DYNAMICS_INSTANCE>/api/data/v9.1/
https://login.microsoftonline.com
, such as https://login.microsoftonline.com/mydomain.onmicrosoft.com
Now, configure a web resource in Microsoft Dynamics that can push the data to :
In the editor, paste the sample code below. Notice this code includes the placeholder <YOUR_URL_HERE>. This requires a URL that is accessible only after you complete the sync setup. We will revisit this code block later to replace it with the final URL.
function trimMSid(msid) { if (msid == null) return null; msid = msid.replace('{', '').replace('}', ''); return msid.toLowerCase(); } function doSync(executionContext){ var formContext = executionContext.getFormContext(); var recordid= formContext.data.entity.getId(); var tablename = formContext.data.entity.getEntityName(); var url = ' <YOUR_URL_HERE>'; if(tablename && recordid){ url = url+'&SeanceValidator.Kick.Logged.Users=false&explicittables='+tablename+'&explicitids='+trimMSid(recordid); } if (url != '') { var win = window.open(url, '_blank', 'height=150,width=300,location=0,resizable=0'); win.moveTo(500, 300); setTimeout(function() { win.close() }, 15000); } } function startSync(executionContext){ var formContext = executionContext.getFormContext(); var recordid= formContext.data.entity.getId(); if( recordid && recordid.trim().length > 0) { doSync(executionContext); } else { formContext.data.entity.addOnPostSave(doSync ); } } |
You can push updates from Dynamics automatically when records are saved, or manually, by creating a custom button that users can click to sync records. You can use one or both of these methods.
The simplest way to make sure Dynamics updates are synced to promptly is to automatically sync when Dynamics records are saved.
Creating a custom button involves customizing the command bar, which is documented in helpful detail by Microsoft in Customize the Command Bar. In particular, follow the steps on that page to use the app designer, create modern commands, edit the command bar, create a new command, and use JavaScript for actions.
When you reach the final steps for using JavaScript for actions:
StartSyncToAgiloft
, the Dynamics instance would use the name agiloft_StartSyncToAgiloft
.As on the Dynamics side, you need to make a few adjustments to the tables and fields in to help records sync smoothly.
For each table in that you want to sync:
With both systems prepared, you are ready to set up the sync configuration in . Note that in some cases, integration with Microsoft Dynamics lends itself to the sync option to allow multi to multi table mappings, which is not available for two-way sync. If you need to use this option, simply create two one-way sync configurations, where one sends data from to Dynamics and the other sends data from Dynamics to . For example, if you want to sync a company's main location from to the address fields in the Dynamics Account entity, you need to use one-way configurations so you can utilize the multi to multi mapping option. This is because the Company table has links to the Location table in , but the addresses in Dynamics aren't links.
If you're syncing contract data to Dynamics, we recommend creating a separate sync configuration that syncs Contract Types data. That way you can sync the types to Dynamics before syncing the contract data that points to them. |
File with Versioning Fields must be mapped to the Notes of the corresponding entity in Dynamics, rather than mapping to a file field in Dynamics. As such, only one File with Versioning field can be mapped to a single Dynamics entity.
To set up a new sync configuration:
In your knowledgebase, go to Setup > Sync > New > External Sync.
Set up Directions, Related tables, and Conflicts. Pay special attention to how you configure Conflicts if you are setting up two one-way sync configurations. This setting determines which system is treated as the source of truth during the sync, and which system's content may be overwritten.
If desired, set up personal synchronization options or API calls.
Click Next.
https://<YOUR_DYNAMICS_INSTANCE>/api/data/v9.1/
The Dynamics Microsoft Online authority, in the form https://login.microsoftonline.com/<YOUR_DOMAIN>
, such as https://login.microsoftonline.com/mydomain.onmicrosoft.com
Initially, the cached metadata section is empty. This is available after you finish setting up the configuration, if you return to make edits. |
Locate the table in the list and then select the corresponding Dynamics entity from the drop-down menu.
Click Map. The Field Mapping wizard opens. On the Field Mapping tab:
In the Record Modification Timestamp Field, select a field that provides the timestamp in each system to indicate the latest version of the record. If you set the table to Synchronize in the System Update Type in the next step, the timestamp field is compared between systems to determine which record's values are synced to the other system.
For each Dynamics field you want to sync, select the corresponding field from the drop-down. Then, choose whether the field value is updated in , Dynamics, or both systems. Update options are disabled if the sync direction does not permit them. For fields with multiple choice values, complete the dialog box that opens to map individual choice fields.
Use this tab to map links to single fields, but not complete linked sets. Linked sets should instead be mapped in step 5 below, on the Relation Mapping tab. |
On the Relation Mapping tab, you need to explicitly match any linked field relationships across mapped tables that you did not select on the Mapping tab. In general, it's best to use the Mapping tab for links to single fields, or linked sets where only one of the fields in the set will be synced. For linked sets, use Relation Mapping to connect the complete set with the appropriate Lookup field in Dynamics.
Set any linked field relations between mapped tables.
On the Running tab, choose whether synchronization is initiated manually, via actions and rules, or via Dynamics. For more discussion of these options, see Configure Dynamics to Initiate Sync.
To run a sync manually, go to a table's action bar and select Actions > Sync > Run [Configuration Name]. |
Click Finish.
After you set up the sync configuration, there are a few minor but important adjustments that still need to be made in each system.
On the side, you need to determine if and how to automate the sync. In most cases, rules are used to automate syncing whenever a record is created, updated, or deleted. You might append a Dynamics sync action to an existing rule, or create a new rule that runs whenever a record in the table is touched. This action typically checks the ID for Dynamics field, populates it if needed, and then runs a sync action tied to the Dynamics sync configuration. The sync action should be configured to sync a single record only. It is usually best to set this rule not to trigger any other rules, and not to update default values.
Next, use to generate the hotlink URL you need to finalize some code in Microsoft Dynamics.
https://example.agiloft.com/gui2/login.jsp?keyID=0&user=SYNC_USER&password=SYNC_PW&kb=KB_NAME&action=sync&externalSystemID=SYNC_ID
With the encrypted hotlink ready to go, you can finally update the placeholder in the StartSyncToAgiloft web resource you created at the beginning.
In the editor, locate the placeholder <YOUR_URL_HERE>. Replace this text, including the <> symbols, with the encrypted hotlink you generated in .
File with Versioning Fields must be mapped to the Notes of the corresponding entity in Dynamics, rather than mapping to a file field in Dynamics. As such, only one File with Versioning field can be mapped to a single Dynamics entity.
For many Dynamics integrations, the best way to seamlessly integrate the Attachments table in with Dynamics is to map that table to the Notes, or Annotation, entity. With this configuration, an Attachments field is created in the Dynamics entity for the purposes of sync. This Attachments field is mapped to the Attached File field in , and marked to update in the external system only. The Step ID is mapped to the ID for Dynamics field created in , and marked to update in the external system only and to be treated as identifying. The Title field in Dynamics is mapped to the Title field in .
On the Relation Mapping tab, map the Note / Attachment to the Attachment > Contract relationship.
This configuration supports creating and updating files in both and Dynamics. Deletion is supported only in , as Dynamics cannot pass the ID of a deleted record through to ; this means files deleted in Dynamics will persist in . Unlinking an attachment from a contract is partially supported, in that it updates the record in Dynamics to remove the connection, but does not delete or otherwise remove the file.
These additional resources might be helpful while setting up, testing, and using your Dynamics integration.
Integrations between systems often have some limitations based on system differences. The integration with Microsoft Dynamics has a few notable limitations:
Related articles |