You didn't say, but I'm assuming you probably have a field that indicates "Active Employee" or "Ex-Employee" for each record (or something similar), or perhaps even a termination date to determine if that person is an ex-employee. You can either make "Birthday Reminder" checkbox set with an optional "Auto-Entry" calculation that is based on the status of the field that determines whether that person is an active or inactive or ex-employee, or you could attach a script trigger to the employment status check box or popup menu (or termination date edit field) that, when changed, automatically checks or unchecks the "Birthday Reminder" checkbox. There's another dozen or so ways to do this, too (including server side scheduled scripts, etc.), but the suggested I listed above are probably the easiest and most popular two ways to handle problems like this.
Thank you, i will try it out and get back to you
Let me back away from the specifics of the problem just a bit and ask a couple of policy questions.
(1) Do you want to send this birthday notification to every employee as a matter of course, or only to employees who specifically say they'd like to know this kind of info about their co-workers?
(2) Do you limit the notification only to people who work in the same department (section, building, etc.) as the birthday person or is it supposed to go to everyone in the entire company?
(3) Do you track whether a given employee wants her or his birthday to be publicized to the co-workers?
I think I would just add the check for active to the script that sends the notices.
If ( active )
... whatever you are doing to email now ...
no need to uncheck the birthday notice just because they aren't there.
I would like to send the notification to all the employees in the company regardless of their department. The reason I need a trigger is because after an employee have resigned, we still keep record of him/her but we do not need him/her to be part of the notifications anymore thus I want to create a trigger that will keep the remainder field unchecked after resignation.
1 of 1 people found this helpful
You did not see my reply?
Just add the test for "active" to the script that sends the notifications.
What determines "active" is as other have suggested.
Levi, since you're new here, you probably haven't yet discovered that Beverly is always spot on with her advice. That's how she earned that "15" on her avatar.
Incidentally, excellent idea to keep the records of the ex-employees rather than deleting them. In every table I create, I have 3 date fields: Created (auto-entered with creation date), Updated (auto-entered with modification date), and Obsoleted (manually entered via a script attached to a button whenever the user deems it appropriate). Each of these has a counterpart text field (Creator, Updater, and Obsoleter) that gets auto-entered with the log-in name of whoever performed the corresponding action. Furthermore, there's a calculation field called "Active", formatted as a check box with value list One (= 1) that's computed as If ( IsEmpty ( Obsoleted ); 1; "" ). It's handy in situations like yours. I commend this practice to you.
thank you, I will try this out soon