In AX 2012 R2 CU7 we have noticed a bug when accessing questionnaire answers from the Case Listpage or Case Detail forms. The Answer Form shows all answers given for that questionnaire. We needed it to show the answer related to the case.
In order to only show the answer relating to the case on the CaseDetail form you only have to change the datasource property on the button. From CaseDetailBase to CaseDetailBase_CaseDetail:
The reason for this is the link to the Answer is located on the CaseDetail table which extends the CaseDetailBase table (table inheritance).
The CaseListPage is a bit more tricky. In order for it to pull the related answer you need to modify the underlying query by joining to the CaseDetail table and then setting the button datasource property to that table. Since we were not using EP I chose to override the clicked method on the button. To do this you need to change the buttons Display Target property to Client. I then put the following code in the buttons clicked method.
void clicked()
{
Args args;
CaseDetail caseDetail;
caseDetail = CaseDetail::findRec(CaseDetailBase.RecId);
args = new Args();
args.caller(element);
args.record(caseDetail);
new MenuFunction(menuItemDisplayStr(KMKnowledgeCollectorResultAnswer), MenuItemType::Display).run(args);
}
The post Case Questionnaires Not Displaying Related Answers appeared first on Arbela Tech.
*This post is locked for comments