Use webform submission id in custom content type

765 views Asked by At

I am working on a patient/doctor kind of project where by the patient fills a questionnaire and then the doctor provides a prescription.

I have used webform module to create the questionnaire which the patients would fill, and i have created a custom content type for the prescription.

II am working on a patient/doctor kind of project where by the patient fills a questionnaire and then the doctor, provides a corresponding prescription. I have used Webform module to create the questionnaire which the patients would fill. I have created a custom content type for the prescription.

I need to be able to relate the submission Id of the questionnaire to the prescription but I am not sure how to do it.

I have tried the node reference module but that only gives me access to the questionnaire not submission id of the questionnaire.

Please note that a patient can fill various questionnaires so it is quite important that I use the submission id as it seem as the only unique id available. need to be able to relate the submission Id of the questionnaire to the prescription but i am not sure how to do it.

I have tried the node reference module but that only gives me access to the questionnaire not submission id of the questionnaire

2

There are 2 answers

0
gables20 On BEST ANSWER

The entity form module and entity reference provides the required functionality.

1
Ranjeet SIngh On

There is function

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.