SBX - Search With Button

SBX - Forum Post Title

Extensible Data Security Policies on HcmWorker table issue

Microsoft Dynamics AX Forum

Roberto Atzeni asked a question on 27 Feb 2015 5:11 AM
My Badges

Question Status

Verified

Hello to all,

I need help to solve the following issue using EDSP.

Scenario: we have an enterprise with 1 holding company and 3 subsidiaries, all company are separate legal entities. Workers at a time are employed in only one company of the Group but can move from a company to another.

We uploaded Workers in the DAT company and created for each worker an employment detail to record the information of worker's actual company. The requirement is users of the subsidiaries company can view and modify only workers and employment belonging to their company, while users of the holding can view and change data of all workes.

I thought to create specific roles for users of subsidiaries and associate to each role an Extensible Data Security Policy which using as primary table HcmEmployment and using as constrained table HcmWorker.

In the linked query I specified a range on LegalEntity field with value currentcompany and in the init method I specified  for the query the validTimeStateDateTimeRange from minimun and maximum utcdate values, because I would include in the constrained table the past worker.

Issue: The policy works fine when I list actual worker in a subsidiaries company but the Past worker list is empty. It seems the validTimeStateDateTimeRange in the init method doesn't work.

Can someone suggest a solution?

Best Regards

Roberto

Reply
Anton Venter responded on 1 Mar 2015 2:00 AM
My Badges
Suggested Answer

Hi Roberto,

Have you analysed the SQL query when you select "Past workers"? You can use the AX debugger, AX SQL trace or SQL Server Profiler to do that.

Reply
Roberto Atzeni responded on 2 Mar 2015 3:11 AM
My Badges

Hi Anton,

no I didn't, I'll try.

thank you

Roberto

Reply
Roberto Atzeni responded on 3 Mar 2015 5:48 AM
My Badges
Verified Answer

Hello to all, I solved the issue using as primary table a temporary table with xds method that select all hcmemployment record of current company with the clause validtimestate(mindate, maxdate). The only issue that remains open is about primary table refresh. Using the parameter RefresfFrequency::PerSession, new worker created is showed in pagelist only after user close and reopen session. Using the parameter ReFreshFrequency::PerInvocation,  when user create a new worker the session doesn't respond.

Roberto

Reply
Roberto Atzeni responded on 3 Mar 2015 5:48 AM
My Badges
Verified Answer

Hello to all, I solved the issue using as primary table a temporary table with xds method that select all hcmemployment record of current company with the clause validtimestate(mindate, maxdate). The only issue that remains open is about primary table refresh. Using the parameter RefresfFrequency::PerSession, new worker created is showed in pagelist only after user close and reopen session. Using the parameter ReFreshFrequency::PerInvocation,  when user create a new worker the session doesn't respond.

Roberto

Reply
Anton Venter responded on 1 Mar 2015 2:00 AM
My Badges
Suggested Answer

Hi Roberto,

Have you analysed the SQL query when you select "Past workers"? You can use the AX debugger, AX SQL trace or SQL Server Profiler to do that.

Reply

SBX - Two Col Forum

SBX - Migrated JS