Can someone tell me how I can pull a value from CRM field using C#?
*This post is locked for comments
Can someone tell me how I can pull a value from CRM field using C#?
*This post is locked for comments
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.
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?
thats what i have in my code - i reposted after you noticed the typo
that is the real code...whicih is why its not working?
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);
Where or how do i set the column set?
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"));
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156