# User creation/edit listener

**URL:** <https://forum.inductiveautomation.com/t/user-creation-edit-listener/83805>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [January 4, 2024, 6:24pm UTC](https://forum.inductiveautomation.com/t/user-creation-edit-listener/83805 "2024-01-04T18:24:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyler\_Dolan](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Tyler\_Dolan](https://forum.inductiveautomation.com/u/Tyler_Dolan)\
**Post date:** [January 4, 2024, 6:24pm UTC](https://forum.inductiveautomation.com/t/user-creation-edit-listener/83805/1 "2024-01-04T18:24:09Z")

</div>

I am attempting to run some code in my module when a user is created. I've tried using `InternalUserRecord.META.addRecordListener`, but I can't even get the logger to log in the listener. This is what I have.

```auto
InternalUserRecord.META.addRecordListener(new IRecordListener < InternalUserRecord > () {
    @Override
    public void recordUpdated(InternalUserRecord internalUserRecord) {
        logger.info("record updating");
        // some code
    }

    @Override
    public void recordAdded(InternalUserRecord internalUserRecord) {
        logger.info("record adding");
        // some code
    }

    @Override
    public void recordDeleted(KeyValue keyValue) {
        logger.info("record deleting");
        // some code
    }
});

```

Am I on the right track or is there a better way to accomplish what I'm trying to do?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 4, 2024, 6:26pm UTC](https://forum.inductiveautomation.com/t/user-creation-edit-listener/83805/2 "2024-01-04T18:26:20Z")

</div>

Hmm, I'd expect that to work, as long as you are testing with an internal user source and adding or removing a user from it.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 4, 2024, 6:30pm UTC](https://forum.inductiveautomation.com/t/user-creation-edit-listener/83805/3 "2024-01-04T18:30:30Z")

</div>

I don't think we're actually calling out the new user record being added to the rest of the system...

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 4, 2024, 6:30pm UTC](https://forum.inductiveautomation.com/t/user-creation-edit-listener/83805/4 "2024-01-04T18:30:30Z")

</div>

Hmm - does deleting a user work? The whole record notification thing is hand cranked by each record type, it looks like when a user gets added it may not be notifying listeners.

---

<div class="post-metadata">

**Author:** ![Tyler\_Dolan](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Tyler\_Dolan](https://forum.inductiveautomation.com/u/Tyler_Dolan)\
**Post date:** [January 4, 2024, 6:57pm UTC](https://forum.inductiveautomation.com/t/user-creation-edit-listener/83805/5 "2024-01-04T18:57:00Z")

</div>

I was actually able to get some code to run in the deleted event, but interestingly enough the logger still doesn't log (I tested the logger and it does work outside of this context). Is there a reason the delete event would be firing but not the update or add?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 4, 2024, 7:00pm UTC](https://forum.inductiveautomation.com/t/user-creation-edit-listener/83805/6 "2024-01-04T19:00:44Z")

</div>

> [@Tyler\_Dolan](#):
>
> Is there a reason the delete event would be firing but not the update or add?

Yeah, because the internal user management code isn't notifying listeners when a user is added. Nothing you can do. I opened an issue 🤷‍♂️
