Search This Blog

Thursday, 17 October 2013

X++ Code to fetch the Ranges / Criteria in the run-time Query Dialog

Hi Guys,

The following code helps you to fetch the ranges/criteria in the run-time query dialog .
Paste this code in the Reports->Design->AutoDesign->methods->execute section. 



    QueryBuildRange         range;   
     int                     cnt, i;  
    ;  
    cnt = queryRun.query().dataSourceTable(tablenum(CustTable)).rangeCount();

    for (i=1 ; i<=cnt; i++)
    {
        range = queryRun.query().dataSourceTable(tablenum(CustTable)).range(i);
        info(strfmt("Range Field %1, Value %2",range.AOTname(),range.value()));
    }

No comments:

Post a Comment