Custom Field Not Being Saved programattically through node_save() So there is a custom field I added called 'qid'.  I can see that it is being created with each node.  My issue is that I cannot programmatically save a value to my custom field.  In the code below I will display and instance where I add two values, one to my custom field qid and another to the Ubercart uc_product field height.  Height will be saved successfully and qid will not.

function my_module_test_page() {
  $output = t('foo');

  $node = node_load('151');
  dpm($node);
  $node-&gt;height = '555';
  $node-&gt;qid = '222';
  dpm($node);
  node_save($node);
  $test = node_load('151');
  dpm($test);

  return $output;

}


While I understand that this is probably not enough code to get to the root of the problem I have no idea where to look.  I have scoured the node_save() function and I dont understand why my field is having a problem.  If it helps I have checked field_data_qid in my MYSQL db; however, the table is empty.

EDIT: So the next interesting fold is that when I enter the QID field through the GUI it saves fine.
My suggestion would be to inspect an existing node that already has a value for field_data_qid. Is qid a field created through the Fields GUI? $node->qid is not where I'd expect to see a custom field like this.. $node->field_qid['und'][0]['value'] is a more likely candidate. You'd end up with:

function my_module_test_page() {
  $node = node_load(151);
  dpm($node, 'Pre-modified node');
  $node-&gt;field_qid['und'][0]['value'] = 222;
  dpm($node, 'Pre-saved modified node');
  node_save($node);
  // Passing TRUE for $reset to bump the cache
  $test = node_load(151, NULL, TRUE);
  dpm($test, 'Reloaded node');
  return 'Test page';
}


Also: node_load takes a nid integer as a parameter, not a string: http://api.drupal.org/api/drupal/modules%21node%21node.module/function/node_load/7

See also: https://stackoverflow.com/questions/7876458/drupal-6-drupal-7-migration-field-unds and Best practice for language key for &quot;und&quot; in hook_form_alter