Skip to main content
Community site session details

Community site session details

Session Id : Pl08kmoBh9jCOKmoEJh//w
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Create/Update Records is not working with Lookup (EntityReference) field

Like (0) ShareShare
ReportReport
Posted on 24 Jul 2020 06:46:04 by 2

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

  • v-xida-msft Profile Picture
    on 24 Jul 2020 at 09:46:03
    Re: Create/Update Records is not working with Lookup (EntityReference) field

    HI @hardik_486 ,

    How do you update the LookUp field in your Account Entity? Using Microsoft.Powerplatform.Cds.Client?

     

    Please make sure the 'test_accountid' is the logic name of the LookUp field in your Target Entity. Please go to the CDS in your PowerApps, then find your Target Entity, then find the logic name of the LookUp field, rather than go to your Dynamics CRM.

     

    According to the issue that you mentioned, I think this issue may be related to this ALPHA version -- Microsoft.Powerplatform.Cds.Client -Version 0.2.14-Alpha.

     

    Please consider submit an assisted support ticket through the following link for further help:

    https://powerapps.microsoft.com/en-us/support/pro

     

    Regards,

  • hardik_486 Profile Picture
    2 on 24 Jul 2020 at 06:57:44
    Re: Create/Update Records is not working with Lookup (EntityReference) field

    Hi, 

     

    Thanks for quick response. 

     

    Yes it seems the same issue in other thread. I tried lots of thing but it is not working with lookup fields.

     

    Regards,

    Hardik Shah

  • magesoe Profile Picture
    80 on 24 Jul 2020 at 06:52:55
    Re: Create/Update Records is not working with Lookup (EntityReference) field

    Sounds like the same issue as https://powerusers.microsoft.com/t5/Power-Apps-Pro-Dev-ISV/Operation-return-invalid-status-code-Bad-Request-Microsoft/m-p/635841#M3044

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete