[ExtensionOf(formStr(DimensionValueDetails))]
final class DimensionValueDetails_extension
{

    DimensionAttribute   parmDimAttr()
    {
        return dimAttr;
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    [FormControlEventHandler(formControlStr(DimensionValueDetails, GroupDimension), FormControlEventType::Lookup)]
    public static void GroupDimension_OnLookup(FormControl sender, FormControlEventArgs e)
    {
        FormControlCancelableSuperEventArgs formControlCancel = e as FormControlCancelableSuperEventArgs;
        SysTableLookup                      sysTableLookup =  SysTableLookup::newParameters(tableNum(FinancialDimensionSetting), sender);
        
        Query                   query          = new Query();
        QueryBuildDataSource    queryBuildDataSource;
        
        FormRun             formRun = sender.formRun();//element.args().caller();
        DimensionAttribute dimAttr = formRun.parmDimAttr();

        sysTableLookup.addLookupfield(fieldnum(FinancialDimensionSetting, GroupDimension));

        queryBuildDataSource = query.addDataSource(tablenum(FinancialDimensionSetting));
        queryBuildDataSource.addRange(fieldnum(FinancialDimensionSetting,DimensionAttribute)).value(queryValue(dimAttr.RecId));

        sysTableLookup.parmQuery(query);

        // Perform the lookup.
        sysTableLookup.performFormLookup();

        //cancel super() to prevent error.
        formControlCancel.CancelSuperCall();

    }

}

 

其他教學:

Step 1: Create an extension class for that form

[ExtensionOf(formstr(ProjBudgetImport))]

final class DNTProjBudgetImport_extension

{

}

Step 2: Create a parm method for that variable

projTable   ParmprojTable()

{

return projTable;

}

 

Step 3: Create a button’s onclicked event method and get the value of it

[FormControlEventHandler(formControlStr(ProjBudgetImport, OKButton), FormControlEventType::Clicked)]

public static void OKButton_OnClicked(FormControl sender, FormControlEventArgs e)

{

FormRun             formRun = sender.formRun();//element.args().caller();

ProjTable           projTable = formRun.parmProJtable();

info(strfmt(“%1”,projTable.ProjId));

}

 

Step 4: To get the values of Radio button,Check/Combo box

FormRadioControl markUpDown     = formRun.design().controlName(formControlStr(ProjBudgetImport, markUpDown)) as FormRadioControl;

FormComboBoxControl     sourceType =  formRun.design().controlName(formControlStr(ProjBudgetImport, sourceType)) as FormComboBoxControl;

FormCheckBoxControl     summarizeByCategory = formRun.design().controlName(formControlStr(ProjBudgetImport, summarizeByCategory)) as FormCheckBoxControl;

 

創作者介紹
創作者 lionlionchopper 的頭像
lionlionchopper

呆子獅的夢想世界

lionlionchopper 發表在 痞客邦 留言(0) 人氣()