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
TehreenTehreen 

Update accounts data using a wcf service

Hi,

 

         I need the sample code to update accounts data using a wcf service. I've referred the sample for update in the API, but the code is generating the Object Reference not set to an instance error for the below line of code

 

ForceReference.Account accounts = new ForceReference.Account();
            accounts.Id = accountId;
            accounts.Name = Name;
          

            sObject[] acc = new sObject[2];
            acc[0] = accounts;

            SaveResult[] sr = binding.update(acc); -- Object reference notset to an instance

 

plz help me to resolve the error.

 

Thanks in Advance.

 

Regards,

 Tehreen.

Best Answer chosen by Admin (Salesforce Developers) 
TehreenTehreen

Solved the error by adding binding = new SforceService();