How to restrict entity reference displaying values? I have a requirement which I feel quiet complex. I am using Entity reference in X content type to reference a content type(assume Y). This works fine by displaying all the values of Y in X. 
  Y content type is having one field that is true or false type. So I want to display values in select list of X content type only which is having true value in the Y content type.So how can I achieve that, any suggestions will be appreciated.
You'll have to dynamically create that select list based on the field's values which are TRUE from the CT Y. I suppose that this select list belongs to a from, and what a convenient hook hook_form_alter is!

/**
 * Implements hook_form_alter.
 */
function module_name_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'node_xyz_form_id') {
    // Find all referenced items
    $target_ids = $form['field_reference_to_ct_y'][LANGUAGE_NONE][0]['#options'];
    // Load all referenced items
    $nodes = node_load_multiple(array_keys($target_ids));
    foreach ($nodes as $node) {
      if ($node-&gt;field_to_check_if_true[LANGUAGE_NODE][0]['value']) {
         // Alter the select list options
         $form[field_select_list][LANGUAGE_NONE]['#options'][$node-&gt;nid] = $node-&gt;title;
       }
    }
  }
}