You need to sign in to do that
Don't have an account?

How to grab parent ID while inserting child records
Guys, we have a survey page built from visualforce hosted on a force.com site that allows users to submit surveys, survey URL is included as a link in the final response template which is sent out on case closure.
In Salesforce, i created master-detail between Case and Survey object. Now my question is how to relate the submitted surveys to the case? Is this possible?
In Salesforce, i created master-detail between Case and Survey object. Now my question is how to relate the submitted surveys to the case? Is this possible?
It is definitely possible to relate the Survey with the Case. In the VF link which you will send at the Case closure, in that VF link at the end embed the CaseId and handle the same in the Controller/ VF page.
something like: VF_page_link/caId=(CaseId).
There is a free survey app named SurveyForce provided by the Salesforce Labs. It has inbuilt feature to relate the Survey with the Case and Contact. You can have a look at it and check if it suits your need.
Let me know if you need more assistance.
Thanks,
Jainam Contractor
All Answers
It is definitely possible to relate the Survey with the Case. In the VF link which you will send at the Case closure, in that VF link at the end embed the CaseId and handle the same in the Controller/ VF page.
something like: VF_page_link/caId=(CaseId).
There is a free survey app named SurveyForce provided by the Salesforce Labs. It has inbuilt feature to relate the Survey with the Case and Contact. You can have a look at it and check if it suits your need.
Let me know if you need more assistance.
Thanks,
Jainam Contractor
Right now the hyperlink from the template is - https://xxxxx-xxxxx.cs33.force.com/Survey
Below is the controller code - i am not sure to how to grab the Case Id onto the above controller, thanks for your help!
You can create a lookup relation between the Survey and Case object. Using SOQL, get the Case Id to which you want to relate the Survey and then on the Child relationship field say Case__c assign that Case Id and rest logic remains same. i.e insert the Survey record and the case will be associated with the Survey.
Please try this and let me know if it works.
Let me know if you need more assistance. Mark it as the solution if it solved your purpose.
Thanks,
Jainam Contractor,
Salesforce Consultant,
Varasi LLC
www.varasi.com