Hide or remove line FC

Sort:
You are not authorized to post a reply.
Author
Messages
David Williams
Veteran Member
Posts: 1127
Veteran Member
    We need to remove the line FC field from our form. How can you do that?
    David Williams
    John Henley
    Senior Member
    Posts: 3348
    Senior Member
      David, not sure what your specific requirements are, but I did this in the Grant Management application, which is outlined here: https://www.lawsonguru.co...t-All-Together.aspx.

      Here are some code snippets showing some of the technique I used.  Basically, it figured out whether LINE-FC needed to be set to a 'C' or not.  Note that in this application, LINE-FC = D and/or A were not applicable.

      First, hide LINE-FC in the form definition:
      Then, when form is initialized, set LINE-FC to blank on all rows: function FORM_OnInit() {
        // initialize line FC to blank on all rows
        for (var nRow=0; nRow < 11; nRow++) {
        lawForm.setDataValue("LINE-FC","",nRow);
        }
      }


      Finally, when posting the transaction, use some logic (in this app it was based on there being a LINE-NBR value on the row), set LINE-FC to 'C'

      function FORM_OnBeforeTransaction(fc) {
        // user clicked change; based on fields with values entered, set LineFC = "C"
        if(fc == "C") {
          zeroLinesBeforeChange()

          for (var nRow=0; nRow < 11; nRow++) {
            lawForm.setDataValue("LINE-FC","",nRow);
            if (lawForm.getDataValue("LINE-NBR",nRow) != '') {
              lawForm.setDataValue("LINE-FC","C",nRow) }
             }
        }
        return true;
      }
      Thanks for using the LawsonGuru.com forums!
      John
      David Williams
      Veteran Member
      Posts: 1127
      Veteran Member
        Thanks, John. That's exactly what we needed.
        David Williams
        You are not authorized to post a reply.