public with sharing class mytest {
public List<Questions__c> additionalInfoQuestionMaps {get;set;}
public List<Available_Question_Answer_Options__c> additionalInfoQuestionAvailableResponses {get;set;}
public List<retrieveMergedQuestionList> retrieveMergedQuestionLists {get;set;}
public String buildId {get;set;}
public Build__c build {get;set;}
public mytest() {
buildId = 'a1DV00000001BBBBBB';
build = sharedfile.getBuild(buildId);
updateAdditionalInfoQuestionMaps();
updateAdditionalInfoFieldValueIds();
updateAdditionalInfoQuestionAvailableResponses();
}
public void updateAdditionalInfoQuestionMaps() {
additionalInfoQuestionMaps = new List<Questions__c>([SELECT Id, Name,
Associated_Product_Item__c,
Associated_Product__c,
Label__c,
(select Response__c from Responses_Object__r),
Question_Type_Info__c,
Required__c
FROM Questions__c
WHERE Associated_Product__c = :build.Associated_Product__c
ORDER BY Sort_Index__c, Label__c]);
}
public Set<Id> additionalInfoFieldValueIds = new Set<Id>();
public void updateAdditionalInfoFieldValueIds(){
for (Questions__c aimb : additionalInfoQuestionMaps) {
additionalInfoFieldValueIds.add(aimb.Question_Type_Info__c);
}
}
public void updateAdditionalInfoQuestionAvailableResponses() {
additionalInfoQuestionAvailableResponses = new List<Available_Question_Answer_Options__c>([select Id,
Field_Value__c, Question_Type_Info__c
from Available_Question_Answer_Options__c
where Question_Type_Info__c IN :additionalInfoFieldValueIds]);
}
}