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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Fax number from LogisticsElectronicAddress

(0) ShareShare
ReportReport
Posted on by 451

Hi Guys,

I want to get the fax number for a worker to display in a report. The requirement is such that if their is a primary fax number (in the Workers form) I need to get it otherwise the latest fax number created. I could not find a relation between the Worker and the Fax.Can you please help.

Thanks in advance :)

Regards

Aman

*This post is locked for comments

I have the same question (0)
  • Verified answer
    5400 Profile Picture
    7,162 on at
    Please pass current worker person buffer. 
    Recid personRecId; personRecId = HcmWorker.person // Pass current value LogisticsElectronicAddress electronicAddress; electronicAddress = DirParty::primaryElectronicAddress(personRecId, LogisticsElectronicAddressMethodType::Fax); return electronicAddress ? electronicAddress.Locator : '';
  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at
    LogisticsElectronicAddress  logisticsElectronicAddress;
        HcmWorker                   HcmWorker;
        DirPartyLocation            dirPartyLocation;
        DirPartyTable               DirPartyTable;
        int64                       RecIdOfParty;
        ;
    
              RecIdOfParty    = HcmWorker::findByPersonnelNumber("000670").DirPerson().RecId;
    
                select dirPartyTable
                    where dirPartyTable.RecId == RecIdOfParty;
    
                
    
                select firstOnly Description,Type,Locator,LocatorExtension,IsPrimary,IsPrivate,RecId from logisticsElectronicAddress
                    order by logisticsElectronicAddress.IsPrimary desc
                join dirPartyLocation
                    where dirPartyLocation.Party            == dirPartyTable.RecId
                        && dirPartyLocation.IsPostalAddress  == NoYes::No
                        && logisticsElectronicAddress.Location == dirPartyLocation.Location
                        && logisticsElectronicAddress.Type      == LogisticsElectronicAddressMethodType::Fax;


    Here you go.

    The code will find only 1 Fax, if will be primary it will give you primary else it will give you any 1st.

    you may modify code as per needs. also pass Employee Personal Number as per need.

  • Dev Profile Picture
    451 on at

    thanks Bhaskar and Sohaib..it worked :)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans