You need to sign in to do that
Don't have an account?
ccracy
Extending Contact Class
Hi,
I am writing a new class (OurContact) that extends the Contact class.
When I try to type cast Cotnact object to OurContact object, I get ClassCastException. Please suggest what can be done.
Thanks,
Rohit M.
I may not understand your question correctly, but I think you are trying to take an object of type Contact and cast it to YourContact class. That would be impossible because the object wasn't instantiated as type YourContact class. You could take the contact object that you get back from salesforce, and perform a deep copy into an object of YourContact class. Deep copying would be important if you are using the child relationship SOQL requests.