Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

extract field value from crm via c#/

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Can someone tell me how I can pull a value from CRM field using C#?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: extract field value from crm via c#/

    I agree with others: include the full code you expect to be executed for the purpose of this task, I'm sure community will be happy to help.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: extract field value from crm via c#/

    I think it is being pointed out that you retrieve to the test variable, but then try and get the value from a different object. Hence the new code have you tried using the suggested code?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: extract field value from crm via c#/

    thats what i have in my code - i reposted after you noticed the typo

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: extract field value from crm via c#/

    that is the real code...whicih is why its not working?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: extract field value from crm via c#/

     Still nothing

    private IOrganizationService service;

     string name = null;

      var test = service.Retrieve("salesorder", orderId, new ColumnSet("ordernumber"));

                         name = salesorder.GetAttributeValue<String>("ordernumber");

                           Console.WriteLine("Order Number: " + name);

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: extract field value from crm via c#/

    Where or how do i set the column set?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: extract field value from crm via c#/

    reason why i asked is because it's not showing up in the intellisense.

    it's not a digit despite its an order number. It's a combination of numbers and alpha characters.  This didnt return anything also though in CRM it's showing. The field is defined as a string simple text.

    Console.WriteLine(Rockland Order Number: " + salesorder.GetAttributeValue<String>("ordernumber"));

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans