• Ralitsa Dakova
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hello,
I'm trying to get a SOAP API to retrieve the details of a certain account/accounts using the IDs I got from getUpdated call. 
My code was working fine until now - here is where I get an error: 

Account retrievedAccount = (Account)arrayIDs[0];

Here is the full (almost) code I have:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFAPITest.salesforce;
using System.Web.Services.Protocols;
using SFAPITest;


namespace SFAPITest
{
    class Program
    {
        static void Main(string[] args)
        {

            SforceService binding = new SforceService();
            var result = binding.login("username", "pass");
          
            binding.Url = result.serverUrl;

            binding.SessionHeaderValue = new SessionHeader();
            binding.SessionHeaderValue.sessionId = result.sessionId; 

            Console.WriteLine("Server URL: " + result.serverUrl);
            Console.WriteLine("Session ID: " + result.sessionId);

            GetUpdatedResult updatedObj = binding.getUpdated("Account", DateTime.Today, DateTime.Today.AddDays(1)); 

            sObject[] arrayIDs = binding.retrieve("Type", "Account", updatedObj.ids);
            Account retrievedAccount = (Account)arrayIDs[0];

            Console.ReadKey(); 
        }
    }
}


The error is "The type or namespace name 'Account' could not be found (are you missing a using directive or an assembly reference?)"

Please help - have a missed a part of the documentation? I'm using Visual studio 2008 (I know, a little old - will a newer version help?). Just to confirm - I have NOT renamed the project - I see that has been kind of an issue for other users.

Thank you!
Hello,
I'm trying to get a SOAP API to retrieve the details of a certain account/accounts using the IDs I got from getUpdated call. 
My code was working fine until now - here is where I get an error: 

Account retrievedAccount = (Account)arrayIDs[0];

Here is the full (almost) code I have:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFAPITest.salesforce;
using System.Web.Services.Protocols;
using SFAPITest;


namespace SFAPITest
{
    class Program
    {
        static void Main(string[] args)
        {

            SforceService binding = new SforceService();
            var result = binding.login("username", "pass");
          
            binding.Url = result.serverUrl;

            binding.SessionHeaderValue = new SessionHeader();
            binding.SessionHeaderValue.sessionId = result.sessionId; 

            Console.WriteLine("Server URL: " + result.serverUrl);
            Console.WriteLine("Session ID: " + result.sessionId);

            GetUpdatedResult updatedObj = binding.getUpdated("Account", DateTime.Today, DateTime.Today.AddDays(1)); 

            sObject[] arrayIDs = binding.retrieve("Type", "Account", updatedObj.ids);
            Account retrievedAccount = (Account)arrayIDs[0];

            Console.ReadKey(); 
        }
    }
}


The error is "The type or namespace name 'Account' could not be found (are you missing a using directive or an assembly reference?)"

Please help - have a missed a part of the documentation? I'm using Visual studio 2008 (I know, a little old - will a newer version help?). Just to confirm - I have NOT renamed the project - I see that has been kind of an issue for other users.

Thank you!
Hello,
I'm trying to get a SOAP API to retrieve the details of a certain account/accounts using the IDs I got from getUpdated call. 
My code was working fine until now - here is where I get an error: 

Account retrievedAccount = (Account)arrayIDs[0];

Here is the full (almost) code I have:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFAPITest.salesforce;
using System.Web.Services.Protocols;
using SFAPITest;


namespace SFAPITest
{
    class Program
    {
        static void Main(string[] args)
        {

            SforceService binding = new SforceService();
            var result = binding.login("username", "pass");
          
            binding.Url = result.serverUrl;

            binding.SessionHeaderValue = new SessionHeader();
            binding.SessionHeaderValue.sessionId = result.sessionId; 

            Console.WriteLine("Server URL: " + result.serverUrl);
            Console.WriteLine("Session ID: " + result.sessionId);

            GetUpdatedResult updatedObj = binding.getUpdated("Account", DateTime.Today, DateTime.Today.AddDays(1)); 

            sObject[] arrayIDs = binding.retrieve("Type", "Account", updatedObj.ids);
            Account retrievedAccount = (Account)arrayIDs[0];

            Console.ReadKey(); 
        }
    }
}


The error is "The type or namespace name 'Account' could not be found (are you missing a using directive or an assembly reference?)"

Please help - have a missed a part of the documentation? I'm using Visual studio 2008 (I know, a little old - will a newer version help?). Just to confirm - I have NOT renamed the project - I see that has been kind of an issue for other users.

Thank you!
Hello,
I'm trying to get a SOAP API to retrieve the details of a certain account/accounts using the IDs I got from getUpdated call. 
My code was working fine until now - here is where I get an error: 

Account retrievedAccount = (Account)arrayIDs[0];

Here is the full (almost) code I have:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFAPITest.salesforce;
using System.Web.Services.Protocols;
using SFAPITest;


namespace SFAPITest
{
    class Program
    {
        static void Main(string[] args)
        {

            SforceService binding = new SforceService();
            var result = binding.login("username", "pass");
          
            binding.Url = result.serverUrl;

            binding.SessionHeaderValue = new SessionHeader();
            binding.SessionHeaderValue.sessionId = result.sessionId; 

            Console.WriteLine("Server URL: " + result.serverUrl);
            Console.WriteLine("Session ID: " + result.sessionId);

            GetUpdatedResult updatedObj = binding.getUpdated("Account", DateTime.Today, DateTime.Today.AddDays(1)); 

            sObject[] arrayIDs = binding.retrieve("Type", "Account", updatedObj.ids);
            Account retrievedAccount = (Account)arrayIDs[0];

            Console.ReadKey(); 
        }
    }
}


The error is "The type or namespace name 'Account' could not be found (are you missing a using directive or an assembly reference?)"

Please help - have a missed a part of the documentation? I'm using Visual studio 2008 (I know, a little old - will a newer version help?). Just to confirm - I have NOT renamed the project - I see that has been kind of an issue for other users.

Thank you!