+ Start a Discussion
MrTheTylerMrTheTyler 

Available fields in a retrieved sobject

it possible to programmatically know what fields are available for a given instance of an sobject? Let's say I have a function that takes in a contact sobject that is queried from the database, could it know if let's say the firstname field is available for the particular instance of the sobject and if it is print it out and if not, don't?

 

 

string printFirstname(contact C){
  if (c.firstname.isavailable) system.debug(c.firstname);
}

 

 

Thanks!

 

Tyler