Menu

Adding Columns to Tables

Help
peterock
2008-09-10
2012-11-22
  • peterock

    peterock - 2008-09-10

    I'm working on setting Web Time Entry for my Engineering Company.  We bill for employee time differently according to the employee activity (drafting, design, surveying, etc.).  We include that information on invoices.  In WTE I'm using the Job Class field to store the activity type.  I'm trying to add the Job Class field to the Time Card Approvals Table (and eventually to the Invoice table, which I think will be more complicated since it refers to a different table in MySQL).  I used the "Edit Screen" tool to add a TableComboBox column to the ProjectTable1 of the Time Card Approval screen.  This resulted in the following line being added to TA0150.xml:

    <TableComboBox FIELDNAME="JobClass" DESCRIPTION="Activity" LENGTH="4" PROTECTED="Y" ALIGNMENT="Center" LIST_TABLE_NAME="jobclass" LIST_TABLE_FIELD="JobClass" LIST_TABLE_DESCRIPTION="jobDesc" />

    Now when I open the Time Card Approval screen I get a "Data Base Error - Database Error - Please contact systems administrator" and no unapproved time entries are shown in the table.  I also tried adding "timeentry.JobClass" to the String sql in the getApprovalList DataSet of the TimeAttendanceTimeCard.java file and still got the same error.

    In the MySQL timeentry schema, JobClass is a column in the timeentry table to which the TimeAttendanceTimeCard class refers, so it seems like this should work.  What am I doing wrong?

    By the way, for what is the Job Class field actually intended?

     
    • peterock

      peterock - 2008-09-10

      A little more info - I'm running:
      Windows XP SP3
      JDK 6 Update 7
      MySQL 5.0.67
      Tomcat 6.0.18 as a service

      I have edited all paths in ConfigFile1.xml and web.xml to point to the above Tomcat installation,
      and I am editing the xml and java files that I copied to the webapps folder of the above Tomcat installation.

       
    • Paul Jones

      Paul Jones - 2008-10-23

      Way to go!

       
      • peterock

        peterock - 2008-10-27

        Hmm.  Maybe my second post seemed like I was explaining how I solved the problem, but I haven't actually solved it.  My second post was just additional information on what I had tried.  But that didn't lead to a success.

         
    • Paul Jones

      Paul Jones - 2008-10-28

      Opps!   Sorry Guy… I thought you has resolved this one yourself!

      But anyhow – to get you your problem!

      1 – Editing the XML for the screen is only half the job.  You also need to change the java class for time card approvals.   You need to modify the TimeAttendanceTimeCard. getApprovalList method to include you new column and yes.. adding a column from another table will also require a join on the two tables.

      2 – The job class field can really be used for whatever you wish.  You can enter any description you like in the job class table for each row.  

      See Ya

      Paul...

       

Log in to post a comment.