Sunday, April 11, 2021

How to open new form through code in AX

 /// <param name = "_sender">The AnswersButton control.</param>
    private void onAnswersButtonClicked(FormFunctionButtonControl _sender)
    {
        FormRun formRun = _sender.formRun();
        CaseDetail caseDetailBase_CaseDetail = formRun.dataSource(formDataSourceStr(CaseDetail, CaseDetailBase_CaseDetail)).cursor() as CaseDetail;
        Args answersButtonArgs = new Args();
        answersButtonArgs.caller(_sender);
        answersButtonArgs.record(KMVirtualNetworkAnswerTable::find(CaseDetailBase_CaseDetail.AnswerId));

        new MenuFunction(menuItemDisplayStr(KMKnowledgeCollectorResultAnswer), MenuItemType::Display).run(answersButtonArgs);
    }

No comments:

Post a Comment

Table browser URL in D365FO

Critical Thinking icon icon by Icons8