
Announcements
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
Image 2 - without employee relations
My Expectation is that if relation is removed form should not return any records.
Thanks
*This post is locked for comments
I have the same question (0)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.
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.