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 :
Microsoft Dynamics AX (Archived)

How to get workers private and private email on a SSRS report ?

(0) ShareShare
ReportReport
Posted on by

Hi Everyone,

In addition with the forum i have put my effort  and followed the forum instruction and used this code to fetch workers private email as well :

<
select * from logisticsElectronicAddress
where logisticsElectronicAddress.PrivateForParty == HcmWorker.Person
   && logisticsElectronicAddress.IsPrivate == NoYes::Yes
   && logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email />


but unable to achieve my requirement as this select statement is showing blank record on the report.Below is my embed code :

<
///The method should compute data and populate the data tables that will be returned to SSRS.
private void insertData()
{
//AssetTable assetTable;

 AssetTable assetTable ;
HcmWorker hcmWorker ;

    LogisticsElectronicAddress logisticsElectronicAddress;
    DirPartyTable dirPartyTable;
    //declaring EA_AssettableContract_UI class
    ATO_AssetTableContract contract=this.parmDataContract();
while select * from assetTable
   //inner join with hcmworker
    join RecId from  hcmWorker
       where hcmWorker.RecId==assetTable.WorkerResponsible
 &&  AssetTable.AssetGroup=="Computers"
    //skipping blank values from workername field
    && AssetTable.WorkerName!=" "
    //comparing paramerter to report
        && assetTable.AssetId==contract.parmAssetId()


    join  * from dirPartyTable
where  dirPartyTable.RecId == hcmWorker.Person

 join * from logisticsElectronicAddress
where  logisticsElectronicAddress.PrivateForParty == hcmWorker.RecId
  && logisticsElectronicAddress.IsPrivate == NoYes::Yes
 && logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email


  // && logisticsElectronicAddress.IsPrivate == NoYes::No
   //&& logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email


{
assetTableTmp.clear();

assetTableTmp.AssetId =assetTable.AssetId;
assetTableTmp.AssetGroup =assetTable.AssetGroup;
//tmpAssettable.PersonnelNumber=assetTable.PersonnelNumber
assetTableTmp.WorkerName=assetTable.WorkerName;

    assetTableTmp.Locator=logisticsElectronicAddress.Locator;
  //  assetTableTmp.WorkerName=hcmWorker.PersonnelNumber;
   //     assetTableTmp.Locator=logisticsElectronicAddress.LocatorExtension;
 //personnel number fetching form hcmworker table
  //  assetTableTmp.PersonnelNumber=hcmWorker.PersonnelNumber;







assetTableTmp.insert();
}
}


/>



Can someone assist me what is wrong in the code ? and why we have used PrivateforParty for relation.


thank you

regards


*This post is locked for comments

I have the same question (0)
  • Rohin Profile Picture
    4,624 on at

    Hi Maqbool,

    means you are not getting data from LogisticsElectronicAddress ?? can you use debugger?

  • Community Member Profile Picture
    on at

    I am not getting data because may be the privateforparty field is mostly blank and doesnt contain any data.

    i haven't use debugger before :( . but can learn quickly if you can guide :).

    thank you

  • Verified answer
    Rohin Profile Picture
    4,624 on at

    This is working for me correctly...

    static void Job20(Args _args)
    {
     HcmWorker  hcmWorker;
     DirPartyTable  dirPartyTable;
     DirPartyLocation dirPartyLocation;
     LogisticsLocation  logisticsLocation;
     LogisticsElectronicAddress logisticsElectronicsAddress;
        
        ;
     while select * from hcmWorker 
         join dirPartyTable where hcmWorker.Person == dirPartyTable.recId 
         join dirPartyLocation where dirPartyTable.RecId == dirPartyLocation.Party
         join logisticsLocation where dirPartyLocation.Location == logisticsLocation.RecId
         join logisticsElectronicsAddress where logisticsLocation.RecId == logisticsElectronicsAddress.Location &&
                                                logisticsElectronicsAddress.Type == LogisticsElectronicAddressMethodType::Email
         
        {
            info(strFmt("%1 has Email %2",hcmWorker.name() , logisticsElectronicsAddress.Locator));
        }
    }


    Please try this one.

  • Suggested answer
    Rohin Profile Picture
    4,624 on at

    In addition to above please read documentation for debugger 

  • Community Member Profile Picture
    on at

    Thank you so much VisVash Walia, look pretty much perfect as always :).

    Let me try this and get back to you soon.

    thumbs up .

    Thanks

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans