cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Error update a currency field via CDS Update Record

Hello,

 

I have a flow that updates a record in Dynamics through CDS (Current Environemnt) Update Action. The entity i am trying to update has currency fields and works fine when i pass a positive value to be updated. However when a negative value is being updated the action fails with the error:

 

A validation error occurred for cts_booking.cts_totalgrossamount. The value -90.0000 of type Microsoft.Xrm.Sdk.Money is outside the valid range(0 to 1000000000).

I checked the Min and Max values of the field they are -1,000,000,000.0000 and 1,000,000,000.0000 respectively.

Unsure why this is the case. Any suggestions of how i can handle this error? Thanks in advance.

 

Failed Flow:

Flow Currency Error 1.PNG

The output of the failed action:

{
  "error": {
    "code": "0x80040265",
    "message": "A validation error occurred for cts_booking.cts_totalgrossamount. The value -90.0000 of type Microsoft.Xrm.Sdk.Money is outside the valid range(0 to 1000000000).",
    "innererror": {
      "message": "A validation error occurred for cts_booking.cts_totalgrossamount. The value -90.0000 of type Microsoft.Xrm.Sdk.Money is outside the valid range(0 to 1000000000).",
      "type": "System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]",
      "stacktrace": "   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext, Dictionary`2 optionalParameters)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Upsert(Entity entity)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Update(Entity entity, UpdateOption updateOption)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.UpdateEdmEntity(CrmODataExecutionContext context, String edmEntityName, String entityKeyValue, EdmEntityObject entityObject)\r\n   at Microsoft.Crm.Extensibility.OData.EntityController.PatchEntityImplementation(String& entityName, String key, EdmEntityObject entityDelta)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataUtilities.<>c__DisplayClass10_0`2.<InvokeActionAndLogMetric>b__0()\r\n   at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n   at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
    }
  }
}

 

The Flow Action:

Flow Currency Action 1.PNG

 

Flow Currency Field Details:

Flow Currency Field Details.PNG

8 REPLIES 8
Highlighted
Post Prodigy
Post Prodigy

Re: Error update a currency field via CDS Update Record

Hi @Nithin_Vanam ,

 

I was testing as you mentioned and it did not throw any errors for me while updating negative value in currency field. Can you please try creating a similar flow for testing it out. Could be a glitch in flow.

 

Thanks

Highlighted
Super User III
Super User III

Re: Error update a currency field via CDS Update Record

Hello @Nithin_Vanam 

 

How are you triggering the flow?

 

Please try and trigger normally without using the ‘Test’ button





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





Highlighted
Helper II
Helper II

Re: Error update a currency field via CDS Update Record

Hi @Jcook ,

 

The trigger for the flow is CDS(Current Environment) When a record is created

Flow Currency _1.PNG

 

Flow Currency _2.PNG

Flow Currency _3.PNG

 

@ManishJain: Within the same action i have other currency fields which are updating with a negative value too. I just want to make sure i am not missing anything with my field setup. Thanks.

Highlighted
Post Prodigy
Post Prodigy

Re: Error update a currency field via CDS Update Record

Hi @Nithin_Vanam ,

 

Could you check if there are any validations happening i.e. prevalidation plugins or BR running at server side to check if the value is less than 0 then do not allow to update.

 

Thanks

Highlighted
Helper II
Helper II

Re: Error update a currency field via CDS Update Record

Hi @ManishJain ,

 

I have checked and there are no BR or Validations occurring. I was able to create a record manually in dynamics with a negative value and i could save it.

Highlighted
Post Prodigy
Post Prodigy

Re: Error update a currency field via CDS Update Record

Hi @Nithin_Vanam ,

 

If this is working fine OOB then flow should also work. Please raise ticket for resolution.

 

Thanks

Highlighted
Helper II
Helper II

Re: Error update a currency field via CDS Update Record

@ManishJain, strange but within the same flow there are other currency fields that are being updated with negative values. I am seeing behavior with another flow too.

 

The value being passed to this currency field is a decimal number with a precision of 4. I reduced the precision to 2 but that didn't help. I also verified that the currency field has a precision of Currency.

I have raised a ticket and was able to showcase the same to a support engineer. Not sure when i could expect a resolution though. Thanks for validating that OOB configuration is right from my end.

Highlighted
Helper II
Helper II

Re: Error update a currency field via CDS Update Record

Quick update, i had a screen sharing session with a member of the flow product team and was able to reproduce the issue. It seems the attribute metadata is not refreshing due to some reason which is causing this error. I will post back once a fix is provided. Thanks.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,177)