I'm trying to use flow to create and update products in Dynamics 365 / CRM.
Creating products work fine. However, when I update a product record, I'm getting this error:
{ "code": "", "message": "Property _organizationid_value cannot be updated to null. The reference property can only be deleted.", "innererror": { "message": "Property _organizationid_value cannot be updated to null. The reference property can only be deleted.", "type": "Microsoft.Crm.CrmHttpException", "stacktrace": " at Microsoft.Crm.Extensibility.OData.CrmODataUtilities.ValidatePatchInputProperties(EdmEntityObject entityDelta)\r\n at Microsoft.Crm.Extensibility.OData.EntityController.PatchEntity(String entityName, String key, EdmEntityObject entityDelta)\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()" } }
The _organizationid_value is not a field I can set. It looks like there's something missing in the connector.
Here's a screenshot of the configuration. Creating the record works with the same configuration:
Solved! Go to Solution.
Hi Martijn,
Seems like, I have updated the Product in Dynamics 365.
I switch from Flow to Logic App due a bug in template (or wrong Metadata from Dynamics 365)
Anyway, I MAY update the JSON code, not just the Designer.
Please find below the piece of JSON code.
What I have updated:
"Update_a_record": {
"inputs": {
"body": {
"_defaultuomid_value": "2d4e220b-886c-e711-8113-c4346bac0a3c",
"_defaultuomscheduleid_value": "2c4e220b-886c-e711-8113-c4346bac0a3c",
"description": "descriptioin",
"name": "productname",
"price": 50,
"productnumber": "productId",
"quantitydecimal": 0
},
"host": {
"connection": {
"name": "@parameters('$connections')['dynamicscrmonline']['connectionId']"
}
},
"method": "patch",
"path": "/datasets/@{encodeURIComponent(encodeURIComponent('senturytires.crm'))}/tables/@{encodeURIComponent(encodeURIComponent('products'))}/items/@{encodeURIComponent(encodeURIComponent('b990c0a2-066d-e711-8117-c4346bac8af8'))}"
},
"runAfter": {
"List_records": [
"Succeeded"
]
},
"type": "ApiConnection"
}
Hi @MartijnE,
Thanks for the feedback.
I will make some tests and then update it here once I finished.
Regards,
Michael
Hi,
Any update on this issue?
Regards,
Martijn
Hi Martijn,
I couldn't create a product via Dynamics 365 connector.
Could you share your parameters to create a product?
Thanks!
BTW, Logic App provides more information about errors and gives more usability than Flow.
Hi Martijn,
Seems like, I have updated the Product in Dynamics 365.
I switch from Flow to Logic App due a bug in template (or wrong Metadata from Dynamics 365)
Anyway, I MAY update the JSON code, not just the Designer.
Please find below the piece of JSON code.
What I have updated:
"Update_a_record": {
"inputs": {
"body": {
"_defaultuomid_value": "2d4e220b-886c-e711-8113-c4346bac0a3c",
"_defaultuomscheduleid_value": "2c4e220b-886c-e711-8113-c4346bac0a3c",
"description": "descriptioin",
"name": "productname",
"price": 50,
"productnumber": "productId",
"quantitydecimal": 0
},
"host": {
"connection": {
"name": "@parameters('$connections')['dynamicscrmonline']['connectionId']"
}
},
"method": "patch",
"path": "/datasets/@{encodeURIComponent(encodeURIComponent('senturytires.crm'))}/tables/@{encodeURIComponent(encodeURIComponent('products'))}/items/@{encodeURIComponent(encodeURIComponent('b990c0a2-066d-e711-8117-c4346bac8af8'))}"
},
"runAfter": {
"List_records": [
"Succeeded"
]
},
"type": "ApiConnection"
}
There's some good guidance in your answer about the position of flow vs logic apps.
I'll have look into using logic apps or azure functions. It was my customers request to use flow.
Will this be fixed in Flow in the future? Or not anytime soon?
Thanks for the follow up!
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!