Developer forum

Forum » Development » Notifications.UserOnBeforeSave : Get old user ?

Notifications.UserOnBeforeSave : Get old user ?

Gaëtan Di Caro
Reply

Hello,

 

I'm trying to execute some code when a user saves his profile, so I use UserOnBeforeSave. In there I need to see what changes have been done on certain fields, and so I need to compare the new and old data. However, the UserNotificationArgs seems to only contains the new data.

How can I do that ?


Replies

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply
This post has been marked as an answer

Hi GaĆ«tan,

You could use:  User.GetUsersByID({userId})

Note: there is also a function User.GetUserByID, but it caches result - I suppose it will return user with the new data

Best regards,

Vladimir

Votes for this answer: 1
 
Gaëtan Di Caro
Reply

Thanks Vladimir, it worked :)

 

You must be logged in to post in the forum