I've seen similar questions posted on this subject, but none of them seem to contain answers to my specific question. I have an object in SalesForce to which I have created a reference in Visual Studio. This object contains a number of fields that I would like to update using a C# application. Not only did I grant write access for all user profiles, but about half of the fields I would like to access already had access granted to them for all profiles.

I have tried updating my WSDL xml file and re-importing, as well as using the SalesForce NuGet tool to pull the information in that way. Even so, the object class in the [Object Name].cs file does not contain the SalesForce-provided getters and setters for the fields in question, or in fact, any way at all to access this data.

Initially, I thought that the updates may not have fully taken hold on the SalesForce server, but once I realized that many fields should theoretically have already been accessible, I realized that this couldn't be the case. What do I need to do to ensure that the changes get applied in such a way that they are reflected the next time I pull the WSDL?

  • Is the missing field showing up in the API? Can you get to it via a SOQL query? Nov 21 '16 at 21:03
  • 2
    Try a tool like workbench that only uses the API. Try to do a SOQL query from the API name of the new field Select Id, MyCustomField__c from SomeObject__c. If it doesn't show up there is a permission issue that is preventing the connected user from accessing it. Nov 21 '16 at 21:06
  • I'd remove the related note, its an unrelated question asking for code recommendations. Focus on the issue at hand, and if you're still interested, ask another question with a different subject. Nov 21 '16 at 21:07
  • With Workbench you could also use the info > Standard & Custom Objects area to explore the exposed fields for any sObject. Nov 21 '16 at 21:09
  • Upon using workbench to take a look at things, I found that the field that I was looking for does in fact show up. What does that suggest as far as suggested steps in my Visual Studio project?
    – Inagnikai
    Nov 21 '16 at 21:13

I figured this one out. First, I made sure that all the fields I wanted to access were available to the API. From there, I generated a new WSDL. I saved this as a new xml file, and added a Web Reference to the xml file.

There was a lot of confusion on my end about how to best reference SalesForce within my project. First off, it seems that the NuGet tool is more or less redundant with the WSDL method. The upside is that it adds the necessary data to your config file. However, it is difficult to update the information and files that it generates without having to create a new connection to your server, which can get a little messy, and leaves you with deprecated connections within SalesForce. Also of note is the fact that your Web Reference remembers the xml file from which it was generated. This means that you can update the existing xml file with the new WSDL information generated by SalesForce, then use "Update Web Reference", and any changes you've made to SalesForce will be reflected within your project.

Apologies if any of this seems rudimentary or obvious, but it hung me up for a long time, so I'm leaving it here for anyone else who gets incredibly stuck, as I did.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.