web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Commerce forum / Issue in Trigger with ...
Commerce forum

Issue in Trigger with Custom Request Retail PU20

(0) ShareShare
ReportReport
Posted on by

Hi,

We are upgrading Dynamics Retail form PU12 to PU20.  

 CustomeResponseClass resp = GetChannelConfigurationDataRequest.RequestContext.Execute<CustomeResponseClass >(CustomRequestClass);

When i execute the above mentioned line, it is giving error as mentioned below: 

An error occurred during the Retail Server Request. RequestUri: usnconeboxax1ret.cloud.onebox.dynamics.com/.../GetOrgUnitConfiguration. RequestId: b166eaf9-ae76-4d64-bf69-181242da87d9. Exception: Microsoft.Dynamics.Commerce.Runtime.UserAuthenticationException: Could not retrieve channel identifier when resolving operating unit from request header.
at Microsoft.Dynamics.Retail.RetailServerLibrary.Middlewares.Authentication.OperatingUnitAuthenticationMiddleware.TryResolveChannelMetadata(IOwinContext context, Nullable`1& channelId, String& operatingOrgUnitNumber, String& countryRegionIsoCode)
at Microsoft.Dynamics.Retail.RetailServerLibrary.Middlewares.Authentication.OperatingUnitAuthenticationMiddleware.<Invoke>d__1.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 Microsoft.Dynamics.Retail.RetailServerLibrary.Middlewares.Authentication.DeviceTokenAuthenticationMiddleware.<Invoke>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 Microsoft.Dynamics.Retail.RetailServerLibrary.Middlewares.Authentication.CommerceIdTokenAuthenticationMiddleware.<Invoke>d__3.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 Microsoft.Dynamics.Retail.RetailServerLibrary.Middlewares.Instrumentation.InstrumentationMiddleware.<Invoke>d__6.MoveNext().

An error occurred while trying to retrieve the channel id based on the Operating Unit Number '068'. Exception: Microsoft.Dynamics.Commerce.Runtime.CommerceException: Invalid channel id 0 in current principal. Request type is CustomRequestClass .
at Microsoft.Dynamics.Commerce.Runtime.Workflow.Composition.PipelineRequestTrigger.OnExecuting(Request request)
at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.RunOnExecutingTriggers(Request request, IEnumerable`1 triggers)
at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.Execute[TResponse](Request request, RequestContext context, IRequestHandler handler, Boolean skipRequestTriggers)
at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.Execute[TResponse](Request request, RequestContext context, IRequestHandler handler)
at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.Execute[TResponse](Request request, RequestContext context)
at Sdk.SonWorkflowExtensions.SonCancelReturnOrderTrigger.OnExecuted(Request request, Response response) in C:\CustomTrigger.cs:line 36
at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.RunOnExecutedTriggers(Request request, Response response, IEnumerable`1 triggers)
at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.Execute[TResponse](Request request, RequestContext context, IRequestHandler handler, Boolean skipRequestTriggers)
at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.Execute[TResponse](Request request, RequestContext context, IRequestHandler handler)
at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.Execute[TResponse](Request request, RequestContext context)
at Microsoft.Dynamics.Commerce.Runtime.Client.ChannelManager.GetChannelConfiguration(Int64 channelId)
at Microsoft.Dynamics.Retail.RetailServerLibrary.Middlewares.Authentication.OperatingUnitAuthenticationMiddleware.TryResolveChannelMetadata(IOwinContext context, Nullable`1& channelId, String& operatingOrgUnitNumber, String& countryRegionIsoCode).

An exception of type: 'Microsoft.Dynamics.Commerce.Runtime.CommerceException' occurred while executing CustomRequestClass request by Microsoft.Dynamics.Commerce.Runtime.Workflow.Composition.PipelineRequestTrigger. Error resource id: 'Microsoft_Dynamics_Commerce_Runtime_InvalidChannel', Exception: Microsoft.Dynamics.Commerce.Runtime.CommerceException: Invalid channel id 0 in current principal. Request type is CustomRequestClass.
at Microsoft.Dynamics.Commerce.Runtime.Workflow.Composition.PipelineRequestTrigger.OnExecuting(Request request)
at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.RunOnExecutingTriggers(Request request, IEnumerable`1 triggers).

I have the same question (0)

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Commerce

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans