I've tried the technique described here: http://lucasforge.2bopen.org/2010/06/drupal-6-create-a-node-with-cck-fields-programmatically/
and here: http://drupal.org/node/1111514
Neither seem to work. The node gets created, but the CCK field I'm trying to set never gets set.
Both those just describe using "field_name[0]['value'] = 'something'" but even if I set the field value through the web form and DSM the result it never has 'value' set, just '#default_value'.
I tried setting "field_name[0]['#default_value'][0]['nid'] = 'mynodeid'" but that didn't work either.
This is the structure of the CCK field I'm trying to set:
field_application_discipline_id (Array, 13 elements)
#type (String, 20 characters ) nodereference_select
#default_value (Array, 1 element)
#required (String, 1 characters ) 0
#columns (Array, 1 element)
#title (String, 13 characters ) Discipline ID
#description (String, 0 characters )
#delta (Integer) 0
#field_name (String, 31 characters ) field_application_discipline_id
#type_name (String, 11 characters ) application
#tree (Boolean) TRUE
#weight (String, 2 characters ) 31
#access (Boolean) TRUE
#count (Integer) 9
Any idea why this wouldn't be working?