..
Can
you create something that periodically updates your HR database from
the DotNetNuke database? That might be easier, and also more
controllable.
Do you have any suggestions what that could be? The only thing which comes to my mind is a DNN scheduled task which runs once a week or however, but then the above mentioned about DNN scheduled tasks affect.
If you do anything with
triggers, I would recommend that you do nothing more than send a
message to some other task that the database has changed and the
UserID. Then, have some external task look into the database and get
the information for that user.
Be aware that there are multiple
tables - User, User Profile, and a couple of ASP.NET tables - that
might change when a user makes a change.
I have to add that our HR database is really simple: All user information which need to be updated from DNN are stored in one flat table, so in my imagination I thought it might be a simple task to do something like (pseudo code):
OnDNNUserProfileUpdated() {
dnn_email = user.getEmai();
UPDATE employee_table
SET address = user.getAdress(), cellphone= user.getCellPhone() ...
WHERE email = dnn_email
}
So when a user updates his profile in DNN, the user profile fields from DNN are simply written to the corresponding employee row in the external table which can be found by a matching email address.
Ultimately,
the best solution will be to modify your HR database so that it gets
it's data from the DotNetNuke database, and eliminate the
duplication. Will the HR database sometimes be the source of other
updates? If so, you'll need to handle that, too.
Actually I thought this way would be the more difficult one, as then we would have to deal with the (probably) more complex DNN table structure, maybe DNN tables will change in future (while our HR system will stay the same) etc.