Hi!
I'm trying to add a user to a team using CRM Web API from python script but was thrown with 500 response code (Internal Server Error).
In "C:\Program Files\Microsoft Dynamics CRM\Trace\*-CRMWeb-*.log" file several errors appeared:
- Failed to log the audit record into the database Procedure or function 'p_InsertMultipleAuditRows' expects parameter '@audituseradditionalinfo', which was not supplied. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
- Crm Exception: Message: Failed to insert audit record, ErrorCode: -2147220970, InnerException: System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'p_InsertMultipleAuditRows' expects parameter '@audituseradditionalinfo', which was not supplied.
- Web Service Plug-in failed in SdkMessageProcessingStepId: {1CB0FEB7-5A25-4032-8AC9-307C808580AA}; EntityName: team; Stage: 25; MessageName: AddMembers; AssemblyName: Microsoft.Crm.AuditRelationsPlugin, Microsoft.Crm.Audit, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.AuditRelationsPlugin; Exception: Unhandled Exception: Microsoft.Crm.CrmException: Failed to insert audit record
- MessageProcessor fail to process message 'AddMembers' for 'team'.
- System.Data.SqlClient.SqlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #67261A37: System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'p_InsertMultipleAuditRows' expects parameter '@audituseradditionalinfo', which was not supplied.
- {"Error":{"InnerError":null,"Message":"FaultException`1: Failed to insert audit record"}}
Part of the script:
url = '<CRM_LINK>/api/data/v8.1/teams(<TEAM_ID>)/Microsoft.Dynamics.CRM.AddMembersTeam'
data = {
'Members': [
{
'ownerid': <USER_ID>,
'@odata.type': 'Microsoft.Dynamics.CRM.systemuser'
}
]
}
We are using Microsoft Dynamics CRM 2016 8.1.0.359 version.