public static function getCustomField(Infusionsoft_Generated_Base $object, $name, Infusionsoft_App $app = null)
{
if (strpos($name, '_') === 0) {
$name = substr($name, 1, strlen($name) - 1);
}
if (!property_exists($object, 'customFieldFormId')) {
throw new Infusionsoft_Exception(get_class($object) . ' does not have Custom Fields.');
}
$dataFormField = new Infusionsoft_DataFormField();
if ($object->getAppPoolAppKey() != null) {
$dataFormField->setAppPoolAppKey($object->getAppPoolAppKey());
}
$conditions = array('FormId' => $object->customFieldFormId, 'Name' => $name);
$out = parent::query(new Infusionsoft_DataFormField(), $conditions, 1000, 0, false, $app);
return array_pop($out);
}