Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Employee Self Service displays other employees data if User Relation is removed

(0) ShareShare
ReportReport
Posted on by 675

Hi Guys, 

I was testing ESS form for data validation on EP forms. While testing I observed that if user relation for employee is removed it displays all employees data. have you come accross such issues? Is there some setup do I need to check 

Image 1 - with employee relation

3288.Image-1.png

Image 2 - without employee relations

6013.Image-2.png

 

My Expectation is that if relation is removed form should not return any records. 

 

Thanks

*This post is locked for comments

  • Suggested answer
    Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: Employee Self Service displays other employees data if User Relation is removed

    What’s happening is very natural and as per intention by Microsoft Written code. This is by design of AX. For your referred example have a look at initializeQuery method of HcmCourseAttendeeListPageInteraction

     

    Note down the following lines of code. The systems is adding range of Person/Employee only in case a relationship is found between your UserId and Person/Employee. Without having this relationship System cannot think of which UserId is linked what employee/person

     

     if (personRecId != 0)
        {
            personRange = SysQuery::findOrCreateRange(_query.dataSourceTable(tablenum(HRMCourseAttendee)), fieldnum(HRMCourseAttendee, Person));
            personRange.value(int642str(personRecId));
            personRange.status(RangeStatus::Hidden);
        }



     

    Let’s proceed a bit father and let me add a hard coded range here.

     

    HcmCourseAttendeeListPageInteraction.png

     

    Now this time if I will run my list page on EP it will filter results irrespective of whether there is a relationship or not. Because I am hard coding my value for filter.

     

    Summary/Conclusion:

    This is by design from Microsoft, we have to follow it. We cannot expect the records to be filtered without user relationship. If we will not add user relationship; an user will see all records. If you want to add some of your own mathematics here, you are welcome to do any customization, up to your choice.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans