Hide or remove line FC

 2 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
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
    Posts: 3353
      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