Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Error only when not Debugging

Posted on by 5

Hi Everyxone!

I have a custom plug-In for Dynamics CRM 365 online and get a validation error:

"A validation error occurred. The value of 'justANumberField' on record of type 'entity' is outside the valid range."

To fix it, I tried to debug, but as soon as debug is active the error is not accurrring.

The PlugIn-Registration-Tool works fine, I am able to debug and go through the code step by step, but no exception :O

May anybody help and point me into right direction? I am new to this....

Thanks for reading

*This post is locked for comments

  • Niffler Profile Picture
    Niffler 5 on at
    RE: Error only when not Debugging

    Hi!

    Thanks - but the value is in the range - our posts where at the same time. I had to change the decimal format to en-US.

    Thanks again

  • Suggested answer
    Kalpavruksh D365 CoE Profile Picture
    Kalpavruksh D365 CoE 2,545 on at
    RE: Error only when not Debugging

    Hi,

    This error is due to field data exceeding the allowed range. Please check minimum and maximum range allowed for that field using field properties and make sure to have the data within the allowed range.

  • Suggested answer
    Niffler Profile Picture
    Niffler 5 on at
    RE: Error only when not Debugging

    Found a solution:

    I change the Language-Setting from "de-DE" (german) to "en-US" for the decimal-Format - now it works fine.

    Any suggestion, why? Can't I use the german format here?

    And I am still keen to know why this exception only occured not in debug mode..

    Thanks again I set this to solved but I am very greatful for further information.

  • Niffler Profile Picture
    Niffler 5 on at
    RE: Error only when not Debugging

    Does this help you?  

    at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.CreateInternal(Entity entity, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)

      at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.CreateOrganizationResponse(Entity entity)

      at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)

      at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySetImplementation(String& entitySetName, EdmEntityObject entityObject)

      at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)

      at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)

      at lambda_method(Closure , Object , Object[] )

      at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)

      at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)

    --- End of stack trace from previous location where exception was thrown ---

      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

      at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()

    --- End of stack trace from previous location where exception was thrown ---

      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

      at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()

    --- End of stack trace from previous location where exception was thrown ---

      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

      at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()

  • Niffler Profile Picture
    Niffler 5 on at
    RE: Error only when not Debugging

    Hi!

    Just debugged again and the value that is assigned is '25.00000000000000000000M'.

    I tried to convert by Math.round but the same exception.

    And again, while debuigging it works fine, just after uninstalling profiler exception is thrown.

    Thanks again

  • T.I.A Profile Picture
    T.I.A 1,760 on at
    RE: Error only when not Debugging

    And what is the decimal you are trying to use

  • Niffler Profile Picture
    Niffler 5 on at
    RE: Error only when not Debugging

    Sorry, my mistake - in fact, the max is 1.000.000.000,00

  • Niffler Profile Picture
    Niffler 5 on at
    RE: Error only when not Debugging

    Hi!

    Thanky you for your reply!

    It is a decimal between 0,00 and 1000000,00.

    Does this help?

  • T.I.A Profile Picture
    T.I.A 1,760 on at
    RE: Error only when not Debugging

    what is the number? and under the definition for that field in the solution what is the minimum and maximum?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans