Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

reference group in execute query

(0) ShareShare
ReportReport
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
    5 on at
    RE: reference group in execute query

    Hello Martin,

    thank you for reply.

  • Verified answer
    Martin Dráb Profile Picture
    231,931 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,272 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,931 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans