Skip to main content

Notifications

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

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Relation Between HCMWorker and RetailStoreTable ?

    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.

  • OBarka Profile Picture
    OBarka 32 on at
    RE: Relation Between HCMWorker and RetailStoreTable ?

    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
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Relation Between HCMWorker and RetailStoreTable ?

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

    Thanks,

    Girish S.

  • OBarka Profile Picture
    OBarka 32 on at
    RE: Relation Between HCMWorker and RetailStoreTable ?

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

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Relation Between HCMWorker and RetailStoreTable ?

    Hi OBarka,

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

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Relation Between HCMWorker and RetailStoreTable ?

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

    pastedimage1677805009916v1.png

  • Verified answer
    Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    RE: Relation Between HCMWorker and RetailStoreTable ?

    Hello OBarka,

    Take a look at the following objects:

    Menu item : HcmWorkerListPage_RetailStoreAddressBook

    Query : HcmWorkerListPage_RetailStoreAddressBook

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans