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 add eventHandler in tables's field?

(0) ShareShare
ReportReport
Posted on by 932

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 the same question (0)
  • Sohaib Cheema Profile Picture
    49,679 Super User 2026 Season 1 on at

    do you need to delete record from same table from which record is being modified? or deletion wil happen in another table.

  • Verified answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    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.

  • BASMA Profile Picture
    932 on at

    Thanks for reply Nikolaos Mäenpää ,

    Have you any example to create batch job ?

    How to delete user role?

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    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.

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 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans