function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andrew FandreAndrew Fandre 

SOAP enterprise WSDL sObject properties not accessible in Visual Studio 2015

I'm new to SF development. I've got a project where I'm using an Enterprise SOAP WSDL to make several complex queries. When I get the query result, the properties of each result object isn't accessible. I'm trying to get simple properties like Product2.Name and Product2.Id, but the Visual Studio parser throws an error and won't let me access the properties.

Here's the properties on the record object after binding to a query result.User-added image


But when I try to access the properties in the loop. I can't access any of the properties of the sfObject..
User-added image


How do I access the properties of the query result in an sObject?
 
Andrew FandreAndrew Fandre

As with much of inquiry and learning, often if you think hard enough about a question in order to phrase it enough for another person to understand you can clarify your search requirements to find the solution you needed.

In this case, the sObject is not the proper casting to get the properties I needed. I needed to cast the object as a PricebookEntry in order to access the properties.

User-added image