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 ?