Creating Nodes Programmatically but cannot edit fields using Drupal once created I have a collection of nodes that are created programmatically after having created the content type using Drupal. This is the creation code:

    $node = new stdClass();
    $node-&gt;title = $vals-&gt;title;
    $node-&gt;type = "event_type";
    node_object_prepare($node);         
    $node-&gt;status                       = 1; 
    $node-&gt;promote                      = 0; 
    $node-&gt;comment                      = 0; 
    // title
    $node-&gt;title = $vals-&gt;title;
    // body     
    $node-&gt;body[$node-&gt;language][0]['value']   = $vals-&gt;body;
    $node-&gt;body[$node-&gt;language][0]['summary'] = text_summary($vals-&gt;body);
    $node-&gt;body[$node-&gt;language][0]['format']  = 'filtered_html';
    // intro text
    $node-&gt;field_event_type_intro = $vals-&gt;field_event_type_intro;
    // teaser
    $node-&gt;teaser = $vals-&gt;teaser;
    // data
    $node-&gt;data = $vals-&gt;data;
    // nodewords
    $node-&gt;nodewords = $vals-&gt;nodewords;

    $node = node_submit($node); // Prepare node for saving

    node_save($node);   


This seems to be working but when I then click on one of these nodes to edit it it only shows the title in the edit screen. The body and intro are missing.

What am I doing wrong?
In your code you have:
$node-&gt;field_event_type_intro = $vals-&gt;field_event_type_intro;

But if you want to add values to your fields you can use this:

if is a text
$node-&gt;field_event_type_intro[LANGUAGE_NONE][0]['value'] = field_event_type_intro;

if is a taxonomy
$node-&gt;field_event_type_intro[LANGUAGE_NONE][0]['tid'] = field_event_type_intro;

if is a field reference
$node-&gt;field_event_type_intro[LANGUAGE_NONE][0]['target_id'] = field_event_type_intro;