5

Is there a way that you can "Set data value" of an entity reference field using rules. So I would like to set a newly created node's entity reference field to another node's entity reference field.

Thank you in advance!

  • I would say the answer is yes. However, for something as complicated as Rules your question is very vague. – Adam S Nov 22 '11 at 14:26
  • Hi, Sorry for the vagueness! I have a content type called "Parent" and a content type called "Child" (This is just for this example). I have downloaded the Rules_link module which places a link on a node of your choice. When clicked it triggers an event. In this case the link would be placed on the parent node and when clicked, this should create a new entity which would be a child node. This child node will contain an entity reference field which will reference to the parent node. But I cannot find a way to set the data value of the child node's reference field. Thanks for replying! – N dube Nov 22 '11 at 15:18
2

If you can't work out how to do it with Rules, maybe try a custom module. It's been suggested to me that you could use hook_node_update(), or hook_node_insert() to populate that field.

Check http://drupal.org/node/1388924.

1

Using entity references in rules & More rule Links this might be of some help....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.