Aug 28, 2016

Get form datasource name and table name in X++ (X++에서 Form의 데이터소스 테이블 소스코드로 가져오기)

static void get_FormDataSource(Args _args)
{
    //Declaration
    Args                        _FormArgs = new Args();
    FormRun                     _FormRun;
    FormBuildDataSource         _FormBuildDataSource;
    int                         _i;
   
    //Source code
    _FormArgs.name("EcoResProductDetailsExtended");
    _FormRun = ClassFactory.formRunClass(_FormArgs);
   
    for(_i=1 ; _i<=_FormRun.form().dataSourceCount();_i++)
    {
        _FormBuildDataSource = _FormRun.form().dataSource(_i);
        info(strFmt("Datasource name : %1, Table name : %2",_FormBuildDataSource.name(),tableId2Name(_FormBuildDataSource.table())));
    }
}

No comments:

Post a Comment