Hi,
I have created console application and tried to connect Dynamics 365 using Microsoft.Powerplatform.Cds.Client (.net core package) and everything is working fine. I am also able to fetch the records from Dynamics.
I have tried to create the records with only Name field - for e.g. account["name"] then it is working fine and new records are created in Dynamics. But when I tried to set lookup field - for e.g. dummyentity["test_accountid"] = new EntityReference("account", <GUID of Account>) then it gives below error
Microsoft.Rest.HttpOperationException
HResult=0x80131500
Message=Operation returned an invalid status code 'BadRequest'
Source=Microsoft.PowerPlatform.Cds.Client
I already verified the field names and GUID also exists in dynamics.
Can you please help me out here?
Thanks in advance!
Regards,
Hardik Shah