Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

reference group in execute query

Posted on by 5

Hello,

please do you know how to keep filter on form control reference group?

Example: in form there is field "Worker_Requisitioner" (reference group) it shows names of workers. In table there is RecId of HcmWorker.RecId.

I am trying to filter in form *Petr* and do some action but it is going to execute query and it will refresh (it deletes *Petr*) filter. I need to keep that string... and i tried to put code below

find range and keep him but it is not working.

qBR = SysQuery::findOrCreateRange(
    PurchReqTable_DS.query().dataSourceTable(
            tableNum(PurchReqTable)),
            fieldNum(PurchReqTable, Worker_Requisitioner)
            );
qBR.value(
    PurchReqTable_DS.queryRun().query().dataSourceTable(
            tableNum(PurchReqTable)).findRange(fieldNum(PurchReqTable, Worker_Requisitioner)).value()
            );

  • Petr Drevenka Profile Picture
    Petr Drevenka 5 on at
    RE: reference group in execute query

    Hello Martin,

    thank you for reply.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: reference group in execute query

    You're wrong in thinking that the *Petr* filter is applied to PurchReqTable.Worker_Requisitioner. As you correctly mentioned, that's a numeric RecId field, therefore such a filter value can't apply to it.

    In fact, the range is applied to the HcmWorker table automatically joined to added under the hood to support the reference group.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans
Liquid error: parsing "/forums/thread/details/?threadid=%27nvOpzp;%20AND%201=1%20OR%20(%3C%27%22%3EiKO))," - Too many )'s.