Forum Discussion
mallen81
Aug 25, 2021Copper Contributor
Teams Integration with Dynamics 365 for an Entity showing not connected.
I need to be able to programmatically add a tab to teams that uses the Dynamics 365 teams app for an entity and I need it to show as connected to dynamics. Here is the requests I have built for both...
mallen81
May 24, 2022Copper Contributor
mallen81 I have an update and there is now an api endpoint that can be used to attach an entity record and get the connection symbol to show up correctly.
First you must follow the directions at Enable linking of Dynamics 365 records to Microsoft Teams channels | Microsoft Docs and consent to the permissions that are asked when the options are turned on. Once that is setup you can then make a call that matches the following criteria.
Syntax:
The programmatic support for the Collaborate functionality is implemented as a custom API in Dynamics.
POST <org-url>/api/data/v9.0/msdyn_associateRecordToChannel
Request Body
In the request body, supply a JSON representation of the following properties.
Property | Type | Description |
msdyn_recordId | string | Unique identifier of the entity record or view |
msdyn_entityLogicalName | string | Entity Logical Name of the record or view to be pinned |
msdyn_teamId | string | Unique Identifier of the Team to which the channel belongs |
msdyn_teamInternalId | string | Team Internal Id of the Team to which the channel belongs |
msdyn_teamDisplayName | string | Display Name of the team to which the channel belongs |
msdyn_channelId | string | Unique Identifier of the channel where record is to be pinned |
msdyn_channelDisplayName | string | Display Name of the channel |
msdyn_channelType | string | Type of the channel (standard or private) |
msdyn_appModuleId | string | App Id of the Model-Driven App in Dynamics |
msdyn_orgUrl | string | Dynamics Environment URL |
msdyn_pageType | string | Specifies whether the record is a entity record or a view(entityrecord or entitylist) |
1. Pin an entity record in a channel in Teams
Request
POST https://graph.microsoft.com/v1.0/teams/57fb72d0-d811-46f4-8947-305e6072eaa5/channels
Content-type: application/json
{
"msdyn_recordId": "f3372c45-1a83-ec11-8d20-00224805bb02",
"msdyn_entityLogicalName": "account",
"msdyn_teamId": "511298c7-f02d-43a7-94ec-cc8d3822fab6",
"msdyn_teamInternalId": "19:54d5461eadef4e1bbf1581a08bb31d1b@thread.skype",
"msdyn_teamDisplayName": "New Teamz456",
"msdyn_channelId": "19:54d5461eadef4e1bbf1581a08bb31d1b@thread.skype",
"msdyn_channelDisplayName":"General",
"msdyn_channelType": "standard",
"msdyn_appModuleId": "440eaf39-997e-ec11-8d20-000d3a3b2a9b",
"msdyn_orgUrl": https://tp2sg851meenaltestorg.crm10.dynamics.com,
"msdyn_pageType":"entityrecord"
}
Programmatic issues that are still present in the views of automation.
1. I don't know how to set the settings and consent to the permissions programmatically, I can set the settings in the Organization table in the dataverse but that does NOT consent to the permissions and so the api call does not work.
2. When using the UI there is an option to "Post" to the channel as an announcement. This post has a special embedded link that links to the newly created tab. The formatting appears to go through the Skype api even though it is in teams and I have not figured out how to replicate this announcement functionality at this time.
- p41nk1ll3rFeb 02, 2023Copper ContributorI am facing the same issue as well.
I get the tab created and the entity displayed, but after following the directions at "Enable linking of Dynamics 365 records to Microsoft Teams channels | Microsoft Docs" and consenting to the permissions, the endpoint at <org-url>/api/data/v9.0/msdyn_associateRecordToChannel returns an error stating that "The entity with a name = 'msdyn_associateRecordToChannel' with namemapping = 'Logical' was not found in the MetadataCache. MetadataCacheDetails: ProviderType=Dynamic, StandardCache=True, IsLoadedInStagedContext = False, Timestamp=94241881, MinActiveRowVersion=94241881, MetadataInstanceId=5918160, LastUpdated=2023-01-15 12:59:56.060, OrgId=c65xxxxxx".
Looking at the $metadata from the instance being called, there is no trace of that endpoint either.
Anyone ideas on how to get this pinning issue to disappear?