在自定义内容类型中使用webform提交ID

时间:2014-01-06 16:27:41

标签: drupal-7 drupal-views drupal-webform drupal-content-types

我正在开展一个患者/医生类项目,患者填写调查问卷,然后医生开出处方。

我使用了webform模块创建了患者填写的问卷,并为处方创建了自定义内容类型。

我正在开展一个患者/医生类项目,由患者填写调查问卷然后医生,提供相应的处方。 我使用Webform模块创建了患者填写的问卷。我已为处方创建了自定义内容类型。

我需要能够将调查问卷的提交ID与处方联系起来,但我不知道该怎么做。

我已经尝试了节点参考模块,但这只能让我访问调查问卷而不是问卷的提交ID。

请注意,患者可以填写各种问卷,因此我使用提交ID非常重要,因为它似乎是唯一可用的唯一ID。  需要能够将调查问卷的提交ID与处方相关联,但我不知道该怎么做。

我已经尝试了节点参考模块,但这只能让我访问调查问卷而不是问卷的提交ID

2 个答案:

答案 0 :(得分:1)

有功能

function modulename_webform_submission_insert($node, $submission) {
 // $node will give you the node id of your webform
 // $submission will give you the id of your data which you inserted in web form
}
This function is called just after you insert data through web form. Here you can perform whatever task you want by using those two node and submission id's.

答案 1 :(得分:0)

实体表单模块和实体引用提供了所需的功能。