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

Automatically create record in Dynamics 365 (CRM) from GP

Hi,

 

I have created a flow that  uses a gateway to our test sql server.  I am trying to create new accounts in D365 when new customers are created in Dynamics GP.  I am only brining over a few fields from GP to D365.  Below is the error that is generated every time I try to run the flow. Any ideas? 

 

{ "code": "", "message": "')' or ',' expected at position 8 in '(Donald Wisch )'.", "innererror": { "message": "')' or ',' expected at position 8 in '(Donald Wisch )'.", "type": "Microsoft.OData.Core.ODataException", "stacktrace": " at Microsoft.OData.Core.UriParser.Parsers.FunctionCallParser.ParseArgumentListOrEntityKeyList()\r\n at Microsoft.OData.Core.UriParser.Parsers.SegmentArgumentParser.TryParseFromUri(String text, Boolean allowNamedValues, Boolean allowNull, SegmentArgumentParser& instance, Boolean enableUriTemplateParsing)\r\n at Microsoft.OData.Core.UriParser.Parsers.SegmentArgumentParser.TryParseKeysFromUri(String text, SegmentArgumentParser& instance, Boolean enableUriTemplateParsing)\r\n 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()" } }

 

If you have any other questions or need to see the flow, please let me know.

 

Thanks in advance

Donald Wisch

8 REPLIES 8
Community Support Team
Community Support Team

Re: Automatically create record in Dynamics 365 (CRM) from GP

Hi @wischbone,

 

The error message in the error string you posted is blank.

{ "code": "", "message": "')' 

 

Would you please show the flow configuration and the running details here, better with the screenshot?

 

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.
wischbone
Level: Powered On

Re: Automatically create record in Dynamics 365 (CRM) from GP

Hi @v-micsh-msft,

 

Thank you so very much for your comment.  Below is the entire contents of the failed run.  Note that the newtmc_projectmanager is a custom field.  It's normally populated from the list of users in CRM but I thought I would try passing it over from GP to CRM but of course GP fields are padded and I wonder if that is cuasing the issue.  I need to fix that somehow.  If you need a screenshot of the actual flow then please let me know.

 

ActionFailed. An action failed. No dependent actions succeeded.
Show run  of 1
PreviousNext
Create a new record
5s


BadRequest.
Inputs
Organization Name

Entity Name
accounts
item
{
  "address1_city": "CITY                               ",
  "_newtmc_projectmanager_value": "Donald Wisch         ",
  "address1_line3": "ADDRESS3                                                     ",
  "_primarycontactid_value": "CONTACT                                                      ",
  "new_ingp": true,
  "address1_line1": "ADDRESS1                                                     ",
  "name": "TEST CUSTOMER                                                    ",
  "address1_country": "COUNTRY                                                      ",
  "address1_stateorprovince": "STATE                        ",
  "accountnumber": "TEST001        ",
  "address1_line2": "ADDRESS2                                                     ",
  "address1_postalcode": "ZIP        ",
  "telephone1": "(999) 999-0001       ",
  "address1_fax": "(999) 999-0002       "
}
Outputs
Headers
{
  "Pragma": "no-cache",
  "x-ms-request-id": "00f761d8-7a35-41a5-bedd-4dee7e819c00",
  "Timing-Allow-Origin": "*",
  "Cache-Control": "no-cache",
  "Date": "Thu, 06 Jul 2017 13:57:02 GMT",
  "Set-Cookie": "ARRAffinity=60399012fd538cc9e9434dab83cc998989a70dd2f847ebc7117eb704b9c942d6;Path=/;HttpOnly;Domain=dynamicscrmonlineconnectionprovider-centralus.tip0.p.azurewebsites.net",
  "Server": "Microsoft-IIS/8.0,Microsoft-HTTPAPI/2.0",
  "X-AspNet-Version": "4.0.30319",
  "X-Powered-By": "ASP.NET",
  "Content-Length": "4852",
  "Content-Type": "application/json; charset=utf-8",
  "Expires": "-1"
}
Body
{
  "status": 400,
  "message": "{\r\n  \"code\": \"\",\r\n  \"message\": \"')' or ',' expected at position 8 in '(Donald Wisch         )'.\",\r\n  \"innererror\": {\r\n    \"message\": \"')' or ',' expected at position 8 in '(Donald Wisch         )'.\",\r\n    \"type\": \"Microsoft.OData.Core.ODataException\",\r\n    \"stacktrace\": \"   at Microsoft.OData.Core.UriParser.Parsers.FunctionCallParser.ParseArgumentListOrEntityKeyList()\\r\\n   at Microsoft.OData.Core.UriParser.Parsers.SegmentArgumentParser.TryParseFromUri(String text, Boolean allowNamedValues, Boolean allowNull, SegmentArgumentParser& instance, Boolean enableUriTemplateParsing)\\r\\n   at Microsoft.OData.Core.UriParser.Parsers.SegmentArgumentParser.TryParseKeysFromUri(String text, SegmentArgumentParser& instance, Boolean enableUriTemplateParsing)\\r\\n   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": "tmc-la.crm.dynamics.com",
  "errors": []
}

 

Much thanks,

Donald Wisch

 

Community Support Team
Community Support Team

Re: Automatically create record in Dynamics 365 (CRM) from GP

Hi @wischbone,

 

Thanks for the update.

Status 400 means the JSON provided does not match the one defined by the API.

This should be related with the item part under the Input session you listed.

As you mentioned that newtmc_projectmanager is a custom field, would you please share more details about this field and the entity related information?

If  "_newtmc_projectmanager_value": is defined as a lookup field ( populated from the list of users in CRM ? ), then the value should be an Account GUID, whic you should be able to find with the Users list.

 

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.
wischbone
Level: Powered On

Re: Automatically create record in Dynamics 365 (CRM) from GP

Hi @v-micsh-msft,

 

Thank you for your reply and sorry for the delay in mine.  You are correct abotu this custom field.  It is a lookup to CRM users... nothing fancy.  I changed a few things with this flow.  I changed the data source to not have padded fields.  I made this custom field to not be required, then I added some valid data instead of generic data.  Now when the flow runs, it generates a different error.

Item data

{ "address1_city": "El Sugundo", "_newtmc_projectmanager_value": "ec5cd505-7291-e611-80e3-c4346bacba3c", "address1_line3": "", "new_ingp": true, "address1_line1": "807 Parkview Dr North", "name": "TEST CUSTOMER", "address1_country": "US", "address1_stateorprovince": "CA", "accountnumber": "TEST001", "address1_line2": "Ste. 150", "address1_postalcode": "90245", "telephone1": "(999) 999-0001", "address1_fax": "(999) 999-0002" }

 

Flow Error

{ "code": "", "message": "ResourceID Account_ValidateGeoCodeInfornation was not found.", "innererror": { "message": "ResourceID Account_ValidateGeoCodeInfornation was not found.", "type": "System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]", "stacktrace": " at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Create(Entity entity)\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()" } }

 

Much thanks,

Donald Wisch

VaishaliVyas
Level: Powered On

Re: Automatically create record in Dynamics 365 (CRM) from GP

Hi @wischbone

 

You got any solution for this? Even I am getting this error. Everything is working fine when I am Working on Dev but when I change connection to UAT I get this error.

 

Thanks.

Regards,

Vaishali

VaishaliVyas
Level: Powered On

Re: Automatically create record in Dynamics 365 (CRM) from GP

Hi @wischbone

 

You got any solution for this? Even I am getting this error. Everything is working fine when I am Working on Dev but when I change connection to UAT I get this error.

 

Thanks.

Regards,

Vaishali

wischbone
Level: Powered On

Re: Automatically create record in Dynamics 365 (CRM) from GP

Hi @VaishaliVyas

 

Do you have Field Service installd with your CRM?  I think this may be the issue.  My integrations are working fine now.  It's been a while since I looked at it but let me double check to make sure but I really believe Field Service was causign this issue so I uninstalled it.   Another option may be to update it if there are any updates availabe to it.  I'll get back to you soon.

 

Much thanks,

Donald Wisch

VaishaliVyas
Level: Powered On

Re: Automatically create record in Dynamics 365 (CRM) from GP

Hi @wischbone

 

Thanks for reply. I solved that issue. It was coming because of one of the fields in CRM I made that field to optional after that I can create records.

 

Regards,

Vaishali

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 423 members 5,048 guests
Please welcome our newest community members: