I was looking for a way to set some default values for a member when it’s created.
Looked at the “Saving”-event on the MemberService, figured I’ll check if member.Id == 0 and then set values. But it turns out that the event is called three times when a member is created and any values set the 1st or 2nd time is not stored. Hacked around this to set the values the 3rd time the event is called - but it feels externally hacky.
Is there any other known way to this? It needs to work when members are created in the backoffice or via the the MemberService.
Setting default value when member is created
Hi!
I was looking for a way to set some default values for a member when it’s created.
Looked at the “Saving”-event on the MemberService, figured I’ll check if member.Id == 0 and then set values. But it turns out that the event is called three times when a member is created and any values set the 1st or 2nd time is not stored. Hacked around this to set the values the 3rd time the event is called - but it feels externally hacky.
Is there any other known way to this? It needs to work when members are created in the backoffice or via the the MemberService.
/ m
is working on a reply...