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:
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 Field Details:
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
Hello @Nithin_Vanam
How are you triggering the flow?
Please try and trigger normally without using the ‘Test’ button
Proud to be a Flownaut!
Hi @Jcook ,
The trigger for the flow is CDS(Current Environment) When a record is created
@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.
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
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.
Hi @Nithin_Vanam ,
If this is working fine OOB then flow should also work. Please raise ticket for resolution.
Thanks
@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.
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.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
41 | |
40 | |
37 | |
34 | |
30 |
User | Count |
---|---|
47 | |
36 | |
34 | |
24 | |
24 |