2 Replies Latest reply: Jun 30, 2012 3:55 PM by stephane jeanneteau RSS

    script for filling field with value of latest statut and date form another table

      I need some  help ans as i am beginner I'm sure this question is very easy for many of you
      I have a table (Table interaction) with several information fields for a support service, (Interaction ID, Company, Service, …) and somes fields where I want to fill it with the value of another table (last statut, begin date, end date).
      This another table (table statut) is like this :



      ID              Statut             operator             begin.Day          End. Day

      245         Open idle            Smith              01/01/2012         13/01/2012

      245         Open linked       Jones              13/01/2012         23/01/2012

      245         Resolved             Jones              23/01/2012         25/01/2012

      245         Closed                 Jones              25/01/2012        

      298         Open idle            Smith              17/02/2012         29/02/2012

      298         Open linked       Jones              29/02/2012         10/03/2012

      298         Resolved             Jones              10/03/2012         12/03/2012

      298         Closed                 Jones              12/03/2012        

      765         Open idle            Smith              15/03/2012         27/03/2012

      765         Open linked       Jones              27/03/2012        


      For the interaction ID from the table  Interaction (where I want to fille the fields) i need to look for in the Table Statut, the statut which have the latest date for degin day, in order to find the current statut (or last statut if the interaction is old, so closed).

      This value fill the "last statut" field of the Table interaction and i need also to fill the "begin & end date".


      how i can do that in the script page ?


      Thank you for your help