Best approach for Birthdate interface

 4 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
April
Basic Member
Posts: 15
Basic Member
    Hello - I am building an interface to run monthly and grab all of the employees who have a birthday that month.  I then am emailing the list to the manager (or at least that is my goal).  Right now I have it setup to email the manager, but it occurs multiple times depending on how many employees have a birthday that month.  Would it work if I sent all of the employees with a birthday that month to a file and then somehow pull from that file for the email in order to generate a list?

    I also have it setup as a branch to many msgbuilders (one for each manager).  Is there an easier way to set this up so each manager only sees his/her employee's bdays instead of everyones?

    Thanks, April
    Tim Cochrane
    Veteran Member
    Posts: 154
    Veteran Member
      Here's the option we would use:
      1. add a new index to EMPLOYEE (which is what we did, i don't think EMPSET97 is delivered), where key = Company, Supervisor & Employee.
      2. Build a query using EMPLOYEE and the new key and the relation on PAEMPLOYEE to do a "Select where PAEMPLOYEE.BIRTHDATE month = current month.
      3. Branch to send the email when the supervisor number changes, else continue spinning thru the query adding the results to a MsgBuilder node.
      Tim Cochrane - Principal LM/IPA Consultant
      April
      Basic Member
      Posts: 15
      Basic Member
        I am not sure how to accomplish #3 though. How in the branch am I telling it to hold the data until supervisor A switches to supervisor B?
        Thanks, April
        Tim Cochrane
        Veteran Member
        Posts: 154
        Veteran Member
          Not a problem April, although i'll put a disclamier here that this is only one way to accomplish this, SO...
          In the Start node add 2 variables: one that will hold the EMPLOYEE.SUPERVISOR value, the other is a variable to let the flow know this is the first time thru the query. initialize both to spaces, Ex: firstFound=="", superNum=="".

          Here's how the query loop would work:
          After the EMPLOYEE table query, add a branch where one leg goes to an assign if firstFound="". Assign the supervisor number just found to the variable . You'll only do this assignment once as this is your initial seeding of the supervisor number that you will use later in the loop to determine when the supervisor number changes. Each time you go thru the query loop you'll either add birthdates to the MsgBuilder node or send the email, depending on if the supervisor has changed. Toward the end of the query loop, update superNum with the EMPLOYEE.SUPERVISOR = superNum so that always contains the latest suprvisor found.

          Depending on your javascripting experience and if you want to add custom code to pflow.js, some of this could be handled by pflow.js.

          I've roughed out a query loop in Designer. Email me and I can send a screen shot. There are no guts behind the nodes, but at least you could "see" what I'm thinking.
          Tim Cochrane - Principal LM/IPA Consultant
          John Henley
          Posts: 3353
            If you have the HRSUPER table hierarchy set up, you can query/loop on HRSUPER, then have an inner loop for each supervisor that looks for the supervisor's direct reports who have birthdays.

            Thanks for using the LawsonGuru.com forums!
            John