cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mattcole42
Level: Powered On

Salesforce to Dynamics 365 CRM Opportunity Failing.

When trying to create a new opportunity in Dynamics 365 CRM when an Opportunity is created in Saleforce our flow is failing at the Dynamics CRM Step.

 

We are unable to see what the error is, as the error message is not helpful. We can see the data is retrieved from salesforce, however the insert into Dynamcis fails.

 

Any help or advice would be appreciated greatly.

 

We receive the error:

 

{
  "status": 400,
  "message": "{\r\n  \"code\": \"\",\r\n  \"message\": \"Bad Request - Error in query syntax.\",\r\n  \"innererror\": {\r\n    \"message\": \"Bad Request - Error in query syntax.\",\r\n    \"type\": \"Microsoft.OData.Core.ODataException\",\r\n    \"stacktrace\": \"   at Microsoft.OData.Core.UriParser.Parsers.SegmentKeyHandler.TryCreateKeySegmentFromParentheses(ODataPathSegment previous, KeySegment previousKeySegment, String parenthesisExpression, ODataPathSegment& keySegment, Boolean enableUriTemplateParsing, ODataUriResolver resolver)\\r\\n   at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.TryBindKeyFromParentheses(String parenthesesSection)\\r\\n   at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.TryCreateSegmentForNavigationSource(String identifier, String parenthesisExpression)\\r\\n   at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.CreateFirstSegment(String segmentText)\\r\\n   at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.ParsePath(ICollection`1 segments)\\r\\n   at Microsoft.OData.Core.UriParser.Parsers.ODataPathFactory.BindPath(ICollection`1 segments, ODataUriParserConfiguration configuration)\\r\\n   at Microsoft.OData.Core.UriParser.ODataUriParser.Initialize()\\r\\n   at Microsoft.OData.Core.UriParser.ODataUriParser.ParsePath()\\r\\n   at Microsoft.Crm.Extensibility.OData.CrmEdmEntityReference.CreateCrmEdmEntityReference(Uri link, CrmODataExecutionContext context)\\r\\n   at Microsoft.Crm.Extensibility.OData.TypeConverters.EdmEntityTypeConverter.SetNavigationPropertyToXrmEntity(Entity entity, EntityMetadata entityMetadata, IEdmProperty edmProperty, EntityRelationship entityRelationship, Object propertyValue, Nullable`1 role)\\r\\n   at Microsoft.Crm.Extensibility.OData.TypeConverters.EdmEntityTypeConverter.ConvertToCrmTypeInternal(EdmEntityObject edmTypeValue)\\r\\n   at Microsoft.Crm.Extensibility.OData.TypeConverters.EdmTypeConverterBase`2.ConvertToCrmType(Object edmTypeValue)\\r\\n   at Microsoft.Crm.Extensibility.OData.EdmTypeConverter.ConvertToCrmEntity(EdmEntityObject edmEntity, EntityReference entityReference)\\r\\n   at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)\\r\\n   at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySet(String entitySetName, EdmEntityObject entityObject)\\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.ActionExecutor.Execute(Object instance, Object[] arguments)\\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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\\r\\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"\r\n  }\r\n}",
  "source": "<REMOVED>.<REMOVED>.dynamics.com",
  "errors": [],
  "debugInfo": "clientRequestId: 4ee1f2be-0d65-47f6-8522-8007ede2ff67"
}

2 REPLIES 2
Community Support Team
Community Support Team

Re: Salesforce to Dynamics 365 CRM Opportunity Failing.

Hi @mattcole42,

 

Error code 400 means syntax error.

Could you please share a screenshot of the Dynamics 365 CRM step for the configuration?

Please verify the syntax are all meet the requirements.

For the details about the Syntax requirements, check the document below:

Dynamics 365

For Salesforce, check:

Salesforce

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mattcole42
Level: Powered On

Re: Salesforce to Dynamics 365 CRM Opportunity Failing.

Here is the screenshot of the step as requested.

 

The salesforce step is passing, and we can see the data returned from salesforce.

 

It is the Create a new record in Dynamics that fails.

 

FlowCapture2.png

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 373 members 4,673 guests
Please welcome our newest community members: