web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Relation Between HCMWorker and RetailStoreTable ?

(0) ShareShare
ReportReport
Posted on by 32

how can i get the list of workers attach to RetailstoreTable ?

pastedimage1677788525595v1.png 

pastedimage1677788601591v2.png

  • Suggested answer
    Komi Siabi Profile Picture
    13,253 Most Valuable Professional on at

    Hello OBarka,

    Take a look at the following objects:

    Menu item : HcmWorkerListPage_RetailStoreAddressBook

    Query : HcmWorkerListPage_RetailStoreAddressBook

  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at

    Hi Obarka, You can check Workers in Setup Tab in Stores form.

    pastedimage1677805009916v1.png

  • Verified answer
    GirishS Profile Picture
    27,843 Moderator on at

    Hi OBarka,

    In addition to the above comments, you need to join HcmWorker >> DirAddressBookParty >> RetailStoreAddressBook >> RetailChannelTable >> RetailStoreTable.

    Thanks,

    Girish S.

  • OBarka Profile Picture
    32 on at

    How can i use this query to get the list of workers

  • Verified answer
    GirishS Profile Picture
    27,843 Moderator on at

    You need to join the above-mentioned tables to get the list of workers.

    Thanks,

    Girish S.

  • OBarka Profile Picture
    32 on at

    i try it , i get all workers

    public void lookup()

           {

               Query                       query;

               DirAddressBookParty         DirAddressBookParty;

               RetailStoreAddressBook      RetailStoreAddressBook;

               DirPartyTable               DirPartyTable;

               QueryBuildDataSource        Hcmworker;

               QueryBuildDataSource        DirPerson;

               SysTableLookup              sysTableLookup;

               DirAddressBook              DirAddressBook;

          

               SICDeclarativeOfHumanServicesTable SICDeclarativeOfHumanServicesTableLoc = SICDeclarativeOfHumanServicesTable_ds.cursor();

               RetailStoreTable RetailStoreTableL = RetailStoreTable::find(SICDeclarativeOfHumanServicesTableLoc.Establishement);

               RetailchannelTable RetailchannelTable = RetailchannelTable::findByRecId(RetailStoreTableL.RecId);

               sysTableLookup = SysTableLookup::newParameters(tableNum(HcmWorker), this);

               query = new Query();

               HcmWorker=query.addDataSource(tableNum(HcmWorker));

               while select RetailStoreAddressBook

                   where RetailStoreAddressBook.AddressBookType==RetailAddressBookType::Employee

                   && RetailStoreAddressBook.StoreRecId==RetailchannelTable.RecId

               join DirAddressBookParty

                   where DirAddressBookParty.AddressBook==RetailStoreAddressBook.AddressBook

               join DirPartyTable

                   where DirAddressBookParty.party == DirPartyTable.recId

               {

                   HcmWorker.addRange(fieldNum(HcmWorker, person)).value(int642str(DirPartyTable.ReciD));

             

               }

               

               sysTableLookup.addLookupField(fieldnum(Hcmworker, PersonnelNumber));

               sysTableLookup.addLookupField(fieldnum(Hcmworker, person));

               sysTableLookup.parmQuery(query);

               sysTableLookup.performFormLookup();

           }

  • Verified answer
    GirishS Profile Picture
    27,843 Moderator on at

    You can directly use the query mentioned by komi in the code. If you are using query - Don't use while select - You can pass the query with range to parmQuery method. 

    Refer to the below blog for using static AOT query in X++.

    https://daxbeginners.wordpress.com/2014/08/19/how-to-use-aot-query-through-x/

    Thanks,

    Girish S.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 515 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 417 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 360

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans