web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

How to populate lookup field in C# ?

(0) ShareShare
ReportReport
Posted on by

there are 3 entities - Contact, City, Country

city and country has a relation many to 1 (each city related to only one country)

contact has lookup fields for city and country

my mission is to create a new contact filling up fields firstname,lastname and city in C#.

the country lookup field is supposed to be populated based on what city lookup is set.

i've already generated through crmsvcutil.exe a file that has all the entities but im not sure how to use it to get/set lookup values.

my problem is that i didnt understand how to populate the city and country lookup fields

how to set an existing lookup value to the field in contact ?

also how can i refer to the country thats related to the given City so i would know which country lookup to fill ?

I have the same question (0)
  • Community Member Profile Picture
    on at

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 72 Super User 2026 Season 1

#2
BillurSamdancioglu Profile Picture

BillurSamdancioglu 64 Most Valuable Professional

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans