ESS Modification

 7 Replies
 0 Subscribed to this topic
 13 Subscribed to this forum
Sort:
Author
Messages
Greg Moeller
Veteran Member
Posts: 1498
Veteran Member
    Greetings all:

    Users here want a mod to the ESS. Specifically the Employment section, and the Primary Job Profile link.

    We would like to add the Employment Status to this table. I have found the file that I think I need to modify (empprofile.htm), but am only vaguely familiar with OO programing.

    Can someone provide maybe some examples of what you have done? Or where do we start? Need to find out where it is calling to get the data from the Employee table....

    Thanks much in advance!

    -Greg Moeller
    John Henley
    Posts: 3353
      You do want to make the change in empprofile.htm (make sure you save a copy prior to changing it...)

      There are two places to make the change:

      First, in the GetEmployee() function, where it is building up the AGS call, add emp-status to the list of fields in object.field

      Second, in the DspEmployee() function, copy the block of code for displaying a field (e..g if (NonSpace(obj.paemployee_next_rev_code) != 0)), and change the references from obj.paemployee_next_rev_code to obj.emp_status; also change the field display label from "Next Review Type" to "Employee Status".

      Once you do that, you should be able to see status on the profile. Then it's just a matter of deciding where you want it to display.

      For editorial purposes, I will warn you that ESS and Lawson's concept of OO programming are mutually exclusive!
      Thanks for using the LawsonGuru.com forums!
      John
      Greg Moeller
      Veteran Member
      Posts: 1498
      Veteran Member
        Thanks, John. That works wonderfully. Now I have to ask if there is a way to get the description of the status code, rather than just the status code. A1 is not going to mean anything to a normal user, they would rather see "Active - Full-time". Is there a way to pull from the EMSTATUS table the description collumn instead? or is that outside the scope of ESS?
        John Henley
        Posts: 3353
          I was wondering how long it would take for you to ask this question!

          It's actually easier than you might think; as long as the table relationship is defined (and it is in this case), it can be used in the DME call.
          Modify the GetEmployee DME call (the object.field list) to include emstatus.description. Then in the DspEmployee function, reference obj.emstatus_description rather than obj.emp_status.
          Thanks for using the LawsonGuru.com forums!
          John
          Greg Moeller
          Veteran Member
          Posts: 1498
          Veteran Member
            I have modified it thus:

            object.field = "process-level.name;hm-acct-unit;department.name;"
            +"location.description;supervisor.description;employee;"
            +"job-code.description;paemployee.wk-phone-ext;paemployee.wk-phone-nbr;"
            +"email-address;date-hired;pay-rate;paemployee.hm-phone-nbr;"
            +"paemployee.next-review;paemployee.next-rev-code;adj-hire-date;"
            +"position.description;union.description;"
            +"schedule;pay-step;pay-grade;emstatus.description"

            and in my DspEmployee function

            if (NonSpace(obj.emstatus_description) != 0)
            {
            profile += "  Employee Status  "
            + "  " + obj.emstatus_description+' '
            nextcolor = getNxtClr(nextcolor)
            }
            and this returns the employee number now????

            Help?
            John Henley
            Posts: 3353
              change:
              emstatus.description
              to:
              emp-status.description

              and
              obj.emstatus_description
              to
              obj.emp_status_description
              Thanks for using the LawsonGuru.com forums!
              John
              Greg Moeller
              Veteran Member
              Posts: 1498
              Veteran Member
                Thanks alot, John. Works GREAT now. Question: Is there a list of all the available fields/objects that exist that we can call if necessary?
                John Henley
                Posts: 3353
                  Well...the best place (of course) to look is the Data Dictionary on LawsonGuru.com!
                  https://www.lawsonguru.co...abid/98/Default.aspx

                  If you drill down to the EMPLOYEE table, and then scroll down, you can see all of the fields that are in the tables which are related to EMPLOYEE.

                  If they are related, you can probably include them easily. If not, you'd have to write additional code (more DME lookups) to get them.
                  Thanks for using the LawsonGuru.com forums!
                  John