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
IDEMIDEM 

Object reference not set to an instance of an object.

Hi all,
I am beginning with salesforce, I'm trying integrate app .net with salesforce,
My app show a error like this:
Please help me.

 

Server Error in '/TravelShop' Application.


Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 84: { Line 85: Line 86: txtAddress.Text = getLeadInfoResponse.City.ToString(); Line 87: txtState.Text = getLeadInfoResponse.State.ToString(); Line 88: txtZip.Text = getLeadInfoResponse.PostalCode.ToString();


Keyur PatelKeyur Patel

Hi,

 

Do you have access of getLeadInfoResponse method? If possible then look into that method and try to catch any error from that method.  Sometimes, it may not connect Salesforce service because of firewall or your network security issue.

 

Please handle Null exception with following code

txtAddress.Text = Convert.toString(getLeadInfoResponse.City);

 

If you can share your code with me then i can try to resolve your issue.

 

Regards,

Keyur Patel