Wednesday, September 25, 2013

Run a Query

static void Job3(Args _args)
{
    Query       q;
    QueryRun    qr;

    VendTable   vendTable;
    LogisticsLocation logisticsLocation;
    LogisticsPostalAddress postalAddress;


    q = new Query(queryStr(VendTableListPagePreviewPane));
    qr = new QueryRun(q);
    while (qr.next())
    {
        vendTable = qr.get(tableNum(VendTable));
        logisticsLocation = qr.get(tableNum(LogisticsLocation));
        postalAddress = qr.get(tableNum(LogisticsPostalAddress));

        info(strFmt("Account: %1, location; %2, County: %3", VendTable.AccountNum,
            logisticsLocation.LocationId,
            postalAddress.County));
    }
}

No comments:

Post a Comment