Thursday, July 29, 2021

Get current user store in d365fo using X++.

 Try this below code.


    DirAddressBookParty dirAddParty; RetailStoreAddressBook retailStoreaddBook; RetailStoreTable retailStoreTable; ; select firstonly dirAddParty join retailStoreaddBook where retailStoreaddBook.AddressBook == dirAddParty.AddressBook && dirAddParty.Party == HcmWorker::findByPerson(DirPersonuser::find(curUserId()).PersonParty).Person && retailStoreaddBook.AddressBookType == RetailAddressBookType::Employee join retailStoreTable where retailStoreTable.RecId == retailStoreaddBook.StoreRecId;


Keep Daxing!!

No comments:

Post a Comment