Make a lookup for the Queries

Like all method in Global class (like pickTable)

There is the code for make the same list BUT for the queries.

static str pickQuery()
{
    #ResAppl
    #AOT

    int             i;
    int             nodeCount;
    str             nameStr;
    container       names;

    Object          formRun;

    TreeNode        node;
    TreeNode        child;
    ;

    node        = TreeNode::findNode(#QueriesPath);
    nodeCount   = node.AOTchildNodeCount();
    child       = node.AOTfirstChild();

    formRun     = classfactory.createPicklist();
    formRun.init();

    for (i = 1; i <= nodeCount; i++)
    {
        names  += child.AOTgetProperty("Name");
        child   = child.AOTnextSibling();
    }

    formRun.choices(names, #ImageQuery);
    formRun.caption("@SYS26727");
    formRun.run();
    formRun.wait();

    if (formRun.choice())
    {
        return formRun.choice();
    }

    return '';
}
Advertisements