I have a requirement from my client saying that, set of questions should be populated in Task based on some criteria given by the customer. For example On creating a Task for an Account, then the account automatically will be pull in all the relevant questions in the Task.Before that we need to store the set of questions in Salesforce. Kindly give me some idea to achieve this. Thanks in advance
Updated my question: Apex code:
public class ListQuestions
{
public List<ListTaskQuestions__c> Questions {get;set;}
public ListQuestions()
{
// ListTaskQuestions__c[] allQuestions = [select Question1__c,Question2__c from ListTaskQuestions__c ];
Map<String,ListTaskQuestions__c> allQuestions = ListTaskQuestions__c.getAll();
Questions= allQuestions.values();
}
}
Vf page:
<apex:page Controller="ListQuestions" sidebar="false" >
<apex:form >
<apex:pageblock >
<apex:pageblockTable value="{!Questions}" var="q">
<apex:column value="{!q.Question1__c}"/>
<apex:column value="{!q.Question2__c}"/>
</apex:pageblockTable>
</apex:pageblock>
</apex:form>
</apex:page>
Regards, Lavanya.