diff --git a/src/Spd.Utilities.Dynamics/ODataClientHandler.cs b/src/Spd.Utilities.Dynamics/ODataClientHandler.cs index 546a1adc5..4fab1bc07 100644 --- a/src/Spd.Utilities.Dynamics/ODataClientHandler.cs +++ b/src/Spd.Utilities.Dynamics/ODataClientHandler.cs @@ -7,6 +7,9 @@ namespace Spd.Utilities.Dynamics internal class ODataClientHandler(ISecurityTokenProvider tokenProvider) : IODataClientHandler { private string? authToken; + private static readonly string[] resettableProperties = { + "spd_requestdogsreasons", + "spd_requestdogs" }; public void OnClientCreated(ClientCreatedArgs args) { @@ -17,7 +20,8 @@ public void OnClientCreated(ClientCreatedArgs args) client.Configurations.RequestPipeline.OnEntryStarting((arg) => { // do not send reference properties and null values to Dynamics - arg.Entry.Properties = arg.Entry.Properties.Cast().Where((prop) => !prop.Name.StartsWith('_') && prop.Value != null); + arg.Entry.Properties = arg.Entry.Properties.Cast() + .Where((prop) => !prop.Name.StartsWith('_') && ((resettableProperties.Contains(prop.Name) && prop.Value == null) || prop.Value != null)); }); client.BuildingRequest += Client_BuildingRequest; client.SendingRequest2 += Client_SendingRequest2;