Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I havent worked with that Salesforce API before, so I am a bit stuck on how to connect to the salesforce service.

So far I understood that I have to generate a wsdl file for my account or rather the account of my customer (step 1). So far, so good.

But now the Quickstart (http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_quickstart_steps.htm) says something about "Import the WSDL File into your development platform" (step 2).

How do I import a wsdl file into Visual Studio 2008? I cant find the "Add Web Reference" option which is mentioned in the quickstart.

And if I only need to use the WSDL, what use has the Salesforce Dotnet API package which can be downloaded from the salesforce website (http://wiki.developerforce.com/index.php/Salesforce_Dotnet_API)?

Are there any gotchas I should watch out for when developing applications that use the salesforce API?

1 Answer

+1 vote
by (32.1k points)
edited by

Most of the things you'll need to be aware are:

  • query / queryMore pattern (is needed if you want to pull large sets of data from SalesForce)
  • logging in / logging out - session management
  • how to construct a wrapper class - there is some sample vb.net code you can download as well

So, if you're using SOQL to query your SalesForce data, then you need to filter on a SalesForce date field, you'll then need to format the date string.  Here's one way to do it:

public static string FormatDateForQuery(DateTime dateToFormat, bool includeTime)

{

    if (includeTime)

    {

        return dateToFormat.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss+00:00");

    }

    else

    {

        return dateToFormat.ToUniversalTime().ToString("yyyy-MM-dd");

    }

}

Enroll for Salesforce certification now to fast forward your career! 

Related questions

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...