When trying to update an entity via the Dynamics 365 connector you may encounter the following error.
{ “status”: 400, “message”: “Only 1 of 2 keys provided for lookup, provide keys for SalesOrderNumber,dataAreaId.”, “source”: “127.0.0.1” }
One would think passing the ItemInternalId guid value which is the primary key for the entity as the Object Id property would be adequate to find the record to update. Seems not by the error being thrown back.
Apparently you need to supply the 2 keys, SalesOrderNumber and dataAreaId which was mentioned in the error response message as the Object Id as shown below. Note the comma between the sales order number (Sales Order) and the dataAreaId (Company)
So the item path for the entity to update looking from the code view would look like this:
Enjoy…
HI Im getting an error “message”: “Only 2 of 1 keys provided for lookup, provide keys for ProductNumber/ when i try to update distinctproduct entity in ax
Hi, from the error looks like you are providing 2 keys and it only requires the ProductNumber. Seems like that forward slash after the ProductNumber should not be there. Try updating with a hard coded value, do you still get the same error?
Legend – thanks for this. Trying to update a customer record, the 2 values needed to be the other way around in the encodeUriComponent section e.g.usmf,000013A
Yes your right, apparently there was a bug in the deployment of AX in some of our environments. They were switched in some of our environments. This has now been fixed with a subsequent hotfix.
Thanks. Good Information.