Is there any way to refine the user reference field values based on node references value. Let me explain : I have one node reference field and user reference field in one content type and another node reference is added to user profile fields. Both node reference are of same content type with different name. Is there any way to refine the view of user reference field based on node reference field value.
If what you are asking is can you change the user reference field to something based upon a node reference field, sure, not a problem. But what do you want to change it to? If it's the user id of the creator of the node referenced, that's easy:
// load node in question $node=node_load($nid); // load node referenced in that node $node_referenced=node_load($node->field_node_reference[$node->language]['nid']); // set user referenced in node to the uid of the node referenced in it $node->field_user_reference[$node->language]['uid']=$node_referenced->uid; // save the node node_save($node);
If you want to do this automagically, you can look at hook_node_presave() and have this done every time a node type is saved.
thnx for give your timing frnd.. but i want to change the value on ajax call of change of node reference field value. by give an argument to the view of user reference field.. is there any way to pass argument to a view of user reference field.. Jul 24, 2012 at 4:16