You need to sign in to do that
Don't have an account?
Jose María Nicolás Arfelis
Showing the corresponding Answer field according to the data type in the Question
Hi everybody,
this thread could help other Salesforce Community followers if they are facing the same situation.
Our client requires a sort of dynamic questions for Student Applications via Web forms.
That means, for every academic programm there will be questions the applicant will have to answer.
For example, if the applicant chooses the academic programm "Medicine" on the web form, let's assume the following questions would appear:
1. Have you ever performed complex surgical operations? (Answer Type: Yes or No)
2. If yes, which was your most complex surgical operation? (Answer Type: Text)
3. When did you begin to perform operations? (Answer Type: Date)
That means, according to the selected academic programm, the corresponding questions will appear. And according to the type of question (if picklist, text, Yes/No, numeric, date, multiple choice) the corresponding type of Answer will appear.
I built a custom object called Question with fields Question ID, ID of the academic programm, Type (if picklist, if checkbox, if text, if date, if numeric).
I also built a custom object called Answers with fields Question ID, Application ID, Type (text, numeric, Date, boolean), Answer Text (type text), Answer Numeric (type numeric) , Answer Boolean (type boolean), Answer date (type date).
The idea in Salesforce is that when the question is numeric, the Answer field which should appear should be the Answer numeric, if the question is date type, Answer date should appear, if the question is text or checkbox type, Answer text should appear.
Question ID in the custom object Answer is a lookup to the object Question.
Is there any form to manage this through validation or Visualforce?.
this thread could help other Salesforce Community followers if they are facing the same situation.
Our client requires a sort of dynamic questions for Student Applications via Web forms.
That means, for every academic programm there will be questions the applicant will have to answer.
For example, if the applicant chooses the academic programm "Medicine" on the web form, let's assume the following questions would appear:
1. Have you ever performed complex surgical operations? (Answer Type: Yes or No)
2. If yes, which was your most complex surgical operation? (Answer Type: Text)
3. When did you begin to perform operations? (Answer Type: Date)
That means, according to the selected academic programm, the corresponding questions will appear. And according to the type of question (if picklist, text, Yes/No, numeric, date, multiple choice) the corresponding type of Answer will appear.
I built a custom object called Question with fields Question ID, ID of the academic programm, Type (if picklist, if checkbox, if text, if date, if numeric).
I also built a custom object called Answers with fields Question ID, Application ID, Type (text, numeric, Date, boolean), Answer Text (type text), Answer Numeric (type numeric) , Answer Boolean (type boolean), Answer date (type date).
The idea in Salesforce is that when the question is numeric, the Answer field which should appear should be the Answer numeric, if the question is date type, Answer date should appear, if the question is text or checkbox type, Answer text should appear.
Question ID in the custom object Answer is a lookup to the object Question.
Is there any form to manage this through validation or Visualforce?.
All Answers
<apex:pageBlockSection title="Dynamic fields" columns="1" showHeader="true">
<apex:inputField value="{!object[FieldName]}" />
In my case it is only about the configuration in the Salesforce application, I am not programming the web site, my part is just to configure the mapping in Salesforce.
If my suggestion(s) worked, do let me know by marking the answer as "Best Answer" right under the comment.
This will help the rest of the community should they have a similar issue in the future.
Thank you..
This will help the rest of the community should they have a similar issue in the future.
Thank you..