Skip to main content

Notifications

Dynamics 365 general forum

Create lookup attribute from C#

Posted on by Microsoft Employee

Hope you are having a good day,

I have a big problem with understanding how can I make a lookup field in a form, from C#. I have been reading a lot about it and I know that I need relationships but I cannot understand how. 

Please I need a tutorial or something where I can see how to create it.

PD. I'm using Dynamics 365 free trial, I'm practicing.

Thanks in advance.

Greetings! 

Categories:
  • Suggested answer
    Nadeeja Bomiriya Profile Picture
    Nadeeja Bomiriya 6,804 on at
    RE: Create lookup attribute from C#

    Hi Hector,

    If you are trying to create a field programmatically, then please have a look at below links.

    For creating String, Bool, Int etc fields

    msdn.microsoft.com/.../microsoft.xrm.sdk.messages.createattributerequest(v=crm.5).aspx

    For creating a Lookup, see below.

    msdn.microsoft.com/.../microsoft.xrm.sdk.messages.createonetomanyrequest(v=crm.5).aspx

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans