I have table that contains user, roles, dateStart , EndDate.
When the endDate < date of today => I want to add an eventHandler that deletes role from the user .
Or I can use the modified method of field?
*This post is locked for comments
I have table that contains user, roles, dateStart , EndDate.
When the endDate < date of today => I want to add an eventHandler that deletes role from the user .
Or I can use the modified method of field?
*This post is locked for comments
Yes, just google Dynamics AX create batch job.
For the role you need to find what is the table for user's roles. It's something like SysSecUserRole. Then delete the ones you want.
You can find tables in AX very easily by looking at data sources of forms.
If you have more questions in these topics, please do some web search, then start a new discussion if something is unclear.
Thanks for reply Nikolaos Mäenpää ,
Have you any example to create batch job ?
How to delete user role?
I assume you want to remove the roles when the specified end date is today. You can't use event handler since nothing changes in the table when the today's date changes. So no event is triggered.
Instead you need to develop a batch job that you set up to run daily, read your table (records where endDate is today or earlier), and then remove user's roles.
do you need to delete record from same table from which record is being modified? or deletion wil happen in another table.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156