Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 64797

Retrieve worker email address through X++

$
0
0
Below code snipet is one of the way to retrieve employee/worker's primary email address.

private LogisticsElectronicAddressLocator getInstructorEmail(HcmWorkerRecId  _workerRecId)
{
    LogisticsElectronicAddress  logisticsElectronicAddress;
    HcmWorker                   hcmWorker;
    DirPerson                   dirPerson;
    DirPartyTable               dirPartyTable;

    select hcmWorker
        where hcmWorker.RecId == _workerRecId
    join dirPerson
        where dirPerson.RecId == hcmWorker.Person
    join dirPartyTable
        where dirPartyTable.RecId == dirPerson.RecId
    join logisticsElectronicAddress
        where dirPartyTable.PrimaryContactEmail == logisticsElectronicAddress.RecId;

    return logisticsElectronicAddress.Locator;
}

Viewing all articles
Browse latest Browse all 64797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>