November 07, 2012

Finding all data sources in a form through Job

Finding all data sources in a form through code

Hi ,
Here is small trick to find the datasource in form. Open job node , and a new job and copy paste following code over there,.....

static void AllDataSourcesInForm(Args _args)
    Args args = new Args();
    FormRun fr;
    FormBuildDataSource formBuildDataSource;
    counter i;
    ;"CustTable");   // its your FORM name
    fr = ClassFactory.formRunClass(args);
    for(i=1 ; i<=fr.form().dataSourceCount();i++)
        formBuildDataSource = fr.form().dataSource(i);
        info(new DictTable(formBuildDataSource.table()).name());

When you run this job you get all data source which is used in CustTable Form

- Harry

No comments:

Post a Comment


Note: Only a member of this blog may post a comment.