preloader-matrix

Alfasith

Multiple query values on same field in X++(Dynamic query)

Hi,

static void AlfasithMultipleQueryValue(Args _args)
{
    HcmWorker                         HcmWorker;
    QueryRun                             queryrun;
    QueryBuildDataSource        qbdsHCWorker;
    QueryBuildRange                qbr1, qbr2;
    Query                                   query;
    ;

    query = new query();
    qbdsHCWorker = query.addDataSource(tableNum(HcmWorker));
    qbr1= qbdsHCWorker.addRange(fieldNum(HcmWorker,PersonnelNumber));
    qbr1.value(“0012547”);

    qbr2= qbdsHCWorker.addRange(fieldNum(HcmWorker,PersonnelNumber));
    qbr2.value(“002211457”);

    queryrun    = new queryrun(query);
    while(queryrun.next())
    {
        HcmWorker   = queryrun.get(tablenum(HcmWorker));
        info(strfmt(‘%1 – %2’,HcmWorker.name(),HcmWorker.email()));
    }
}

Regards,

Share on email
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest

Leave a Reply

Your email address will not be published.