Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9065371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:28:58+00:00 2026-06-16T16:28:58+00:00

I have an entity called Samples . Inside that I have many fields, one

  • 0

I have an entity called Samples. Inside that I have many fields, one of them is a ProjectLocation drop down list.

Now I use this code to insert a new instance of type Sample in the CRM through WCF.

Entity sample = new Entity("new_sample");
sample.Attributes["name"]= "Ahmed";

This works but when I want to enter the ProjectLocation I don’t have any idea how should it be accomplished.

This doesn’t work.

Entity projectLoc = service.Retrieve("projectlocation", (new guid here), columnset)
sample.Attributes["new_projectlocation1"] = projectLoc

What can be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:29:00+00:00Added an answer on June 16, 2026 at 4:29 pm

    You need to change your code to return an EntityReference, here is the updated code:

    Entity projectLoc=service.Retrieve("projectlocation",(new guid here),columnset) //retrieves a correct projectloc. 
    sample.Attributes["new_projectlocation1"]=projectLoc.ToEntityReference(); //Now it'll work
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an entity called Person and a set of UIImages for it (One-To-Many).
I have an entity called Entry , which has a one-to-many relationship with an
I have an entity called guestlist that has a 1 to many relationship to
I have an entity called Abono that is the parent class of several other
I have an entity called 'SyncInfo' (including a UUID and a modified date) that
I have an entity called User which can have a list of other Users
I have hibernate @Entity called Video with fields: @Column(name=TC_IN) private BigDecimal tcIn; @Column(name=TC_OUT) private
Say I have an entity called Request that has collections of child entities like
I have an entity called Color that has R,G,B stored, and a subclass that
I have table /entity called SaleRecord with fields such as @Entity public class SaleRecord

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.