Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Business Process Error - MetadataCache

  • 1.  Business Process Error - MetadataCache

    TOP CONTRIBUTOR
    Posted 5 days ago
    Edited by Niels Lønberg 5 days ago
    Hi,

    I'm using the tool 'Set Process Stage' by @Pablo Peralta within the Dynamics 365 Workflow Tools (1.0.54.0) by @Demian Adolfo Raschkovan to update the Active Stage of a Business Process Flow in real-time. This is working fine in my development environment. However, I have now moved the solution to a new environment where I'm getting a Business Process Error related to MetadataCache.

    I'm not sure if it is an error caused by me somehow, the workflow tool or some bug in Dynamics 365.

    1. I have the same version of Dynamics 365 Workflow Tools (1.0.54.0) in both environments
    2. Both environments (Dynamics 365 Online) are running the same server version (9.1.0000.1118) and client version (1.3.948-181220-062045)
    3. I have tried creating a new Business Process Flow in the new environment and updating that using the workflow tool, but the result is the same

    I have pasted the error messages returned by D365 below. I am not getting much wiser be looking at them - but hopefully, some of you can :)

    Any input is appreciated.

    Error Message:
    The entity with a name = 'salesprocess' with namemapping = 'Logical' was not found in the MetadataCache. MetadataCacheDetails: ProviderType=Dynamic, StandardCache=True, IsLoadedInStagedContext = False, Timestamp=1545579, MinActiveRowVersion=1545579

    ErrorDetails.txt:
       at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.CreateInternal(Entity entity, CorrelationToken correlationToken, 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()
    Activity Id: 6ae210c3-aa3c-4569-a63e-442f95e42149​



    ------------------------------
    BR,
    Niels
    ------------------------------


  • 2.  RE: Business Process Error - MetadataCache

    TOP CONTRIBUTOR
    Posted 5 days ago
    I just tried to create a record using the Classic Interface (I'm using Unified Interface otherwise). Here I'm getting a bit more information from the error message - which seems to be related to the workflow tool:

    An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute):  msdyncrmWorkflowTools.Class.SetProcessStage: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.​


    Does anyone know what this means?  



    ------------------------------
    BR,
    Niels
    ------------------------------



  • 3.  RE: Business Process Error - MetadataCache

    SILVER CONTRIBUTOR
    Posted 2 days ago
    Edited by Bhartendu Pandey 2 days ago
    Hello Niels,

    Yep the second error message tells us the exception is indeed coming in from the workflow tool . "An unexpected error occurred from ISV code"

    I guess somewhere it is failing to "have the permissions required by the platform to set a process stage" .
    However if you tried creating a record and you did not have the system admin security role then i would request you to check if the custom business process flow has the required permissions by checking under the Business Process Flow tab for that security role

    ------------------------------
    Bhartendu Pandey
    Willis Towers Watson
    London
    ------------------------------



  • 4.  RE: Business Process Error - MetadataCache

    TOP CONTRIBUTOR
    Posted yesterday
    @Bhartendu Pandey

    Thanks for your input. I'm testing this with the System Admin role, so I shouldn't be that which is stopping me.

    I'll keep digging to see if I can find a solution.

    ------------------------------
    BR,
    Niels
    ------------------------------