You need to sign in to do that
Don't have an account?
hk2012
Unable to get contact information
Hi All,
I am trying to fetch my contact details but unable to do so
Below is my sample code
I have added two entries in contacts which can be seen from UI.
Any guesses what can be the reason for issue?
Thanks in advance.
I am trying to fetch my contact details but unable to do so
Below is my sample code
//create auth client to retrieve token var auth = new AuthenticationClient(); //get back URL and token await auth.UsernamePasswordAsync(consumerkey, consumersecret, username, password); var instanceUrl = auth.InstanceUrl; var accessToken = auth.AccessToken; var apiVersion = auth.ApiVersion; var client = new ForceClient(instanceUrl, accessToken, apiVersion); //Toolkit handles all serialization var contacts = await client.QueryAsync<Contact>("SELECT Id, LastName From Contact"); //loop through returned contacts foreach (Contact c in contacts.Records) { Console.WriteLine("Contact - " + c.LastName); }I get following exception 'A first chance exception of type 'Salesforce.Common.ForceException' occurred in mscorlib.dll' while trying to get contact details.
I have added two entries in contacts which can be seen from UI.
Any guesses what can be the reason for issue?
Thanks in advance.
Shashank (Salesforce Developers)
You might want to check if REST API is enabled for your organization. You can do it using workbench: https://developer.salesforce.com/page/Workbench