Ok, I did some digger on google. ychaugule made a nice function for this problem. Here is the post. Also, reference to the information here:
"But the above code will only work for select list, not for node reference or other types of references. _field_allowed_values() function is a custom function which returns allowed values of reference type field. The function returns allowed values for node reference and term reference field and can be extended to get allowed values of other reference fields as well. - See more at: http://yogeshchaugule.com/blog/2013/get-allowed-values-select-list-field#sthash.xnf89Cgn.dpuf"
<?php function _field_allowed_values($field_name) { // retrieve field configurations from DB. $allowed_values = array(); $query = db_select('field_config'); $query->condition('field_name',$field_name) ->fields('field_config',array('type', 'data')); $result = $query->execute()->fetchAssoc(); // Allowed references type $ref_type = array( 'node_reference', 'taxonomy_term_reference', ); $field_config = unserialize($result['data']); if (in_array($result['type'], $ref_type)) { if ($result['type'] == 'node_reference') { $node_types = array_filter($field_config['settings']['referenceable_types']); $query = db_select('node'); $query->condition('type', $node_types, 'in') ->condition('status', 1) ->fields('node', array('nid', 'title')); $allowed_values = $query->execute()->fetchAllKeyed(0, 1); } elseif ($result['type'] == 'taxonomy_term_reference') { $allowed_values = taxonomy_allowed_values($field_config); } } else { $allowed_values_raw = unserialize($result['data']); $allowed_values = (!empty($allowed_values_raw['settings']['allowed_values']) ? $allowed_values_raw['settings']['allowed_values'] : array()); } return $allowed_values; } $field = _field_allowed_values('FIELD_NAME');