Adding a Drop Down Box - LSF9-iSeries-RPGLE

 8 Replies
 0 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
pmeckes
Basic Member
Posts: 24
Basic Member

    We are trying to add a customer drop down box in RQ10 to link the customer to the req. What are the steps ? I looked at BL120D for the field and BL.SR for the definition and select, but I'm not sure how to proceed. Any help would be appreciated. Thanks

    Jimmy Chiu
    Veteran Member
    Posts: 641
    Veteran Member
      You will need to use design studio to customize the RQ10 form.
      pmeckes
      Basic Member
      Posts: 24
      Basic Member
        Actually you don't. We have 6 other programs we modified screens and print files by hand. I'm just not sure of the steps for a drop down box.
        Jimmy Chiu
        Veteran Member
        Posts: 641
        Veteran Member
          I don't touch any lawson delivered files cause i don't want to claim ownership of the files in the event that I require lawson support. Thus, I use design studio for customized form.
          John Henley
          Posts: 3353

            You really have three parts to this customization:

            1. Adding a drop-down
            2. Populating the drop-down
            3. Relating the customer with the requisition

            Items 1 & 2 are fairly common tasks that can be accomplished with Design Studio.  It's item 3 that is the tough one.  Likely, you will incur future technical debt (read: upgrade pain) if you modify the base RQRQH/REQHEADER table.  You should consider storing it in a user field or what I call a "shadow table".

            Of course, if you're using OE/BL, you might be able to relate back from the requisition to the OE tables via the WHDEMAND records.

            Thanks for using the LawsonGuru.com forums!
            John
            Brian6
            Basic Member
            Posts: 8
            Basic Member
              Hi John,
              I had a quick question on the dropdown list via Design Studio...I'm using another example provided in the forum and it works great with one small problem. On the GM12 screen I'm populating a dropdown list after the user tabs out of the employee field. Seems to work great the first time, but then if the user selects another employee it leaves the values from the last employee and adds the current employees values to the list.

              Here is my original code:
              var DMEstring2 = "/cgi-lawson/dme.exe?PROD=" + vProd + "&FILE=GMLABDIST&FIELD=EFFECT-DATE;&INDEX=GMLSET3&KEY=1=" + vEmployee +
              "====&XCOLS=TRUE&XKEYS=TRUE&XRELS=TRUE&XCOUNT=TRUE&XIDA=TRUE&XNEXT=TRUE&OUT=XML";
              var DMEinfo2 = top.httpRequest(DMEstring2);

              if (DMEinfo2.status)
              {
              alert(DMEinfo2.status);
              return;
              }
              var vOBJDMEXML = new top.DataStorage(DMEinfo2);
              var vRecords2 = vOBJDMEXML.document.getElementsByTagName("RECORD");
              //alert (vRecords.length);
              if (vRecords2.length ==0)
              {
              //alert("No Records Exist");
              return true;
              }
              var miscList = document.getElementById("VALUES_l76");


              var tVals;
              for (var i=0;i <= vRecords2.length; i++)
              {
              var vCols=vRecords2.getElementsByTagName("COL");
              var vEffDate = vCols[0].firstChild.data;
              var vEffDate2 = pfDate(vEffDate, 'MM/DD/YYYY');
              var vEffDate3 = getDateAGS(vEffDate2, 'YYYYMMDD');
              tVals = document.createElement("span");
              tVals.setAttribute("text", vEffDate3);
              tVals.setAttribute("tran", vEffDate3);
              tVals.setAttribute("disp", vEffDate3);
              miscList.appendChild(tVals);

              }

              I tried adding a loop to remove the values before adding new values but it doesn't seem to be working...here is what I tried:
              for( var i = 0; i < miscList.childNodes.length; i++ )
              {
              miscList.removeChild(miscList.childNodes)
              }

              Any ideas on how to get rid of the values from the last employee?

              thanks
              Gary Davies
              Veteran Member
              Posts: 248
              Veteran Member
                I don't use the Lawson dropdown list when I want it to be dynamic, instead I create an element of class "textBox" in the OnAfterDataInit function and append it to the mainDiv element. This gives me full acces to all the www3 functions of dropdowns and I don't have to deal with the VALUE lists.
                Brian6
                Basic Member
                Posts: 8
                Basic Member
                  Thanks for the suggestion...I found a bug with my removeChild logic (caused only some of the members to get removed)...changed it to this and works great now:

                  while (miscList.childNodes.length)
                  {
                  miscList.removeChild(miscList.lastChild);
                  }
                  pmeckes
                  Basic Member
                  Posts: 24
                  Basic Member

                    We have a modification library on our iSeries that we copy lawson screens and programs to for modification. The code pieces are in RPGLE. We are using a user field in the req header file to hold the customer number. I want to change the user field to a drop down and the key number field in the scrn to point to the AR customer field. I think this requires changing the RQ.SR and doing a srgen. Does any of this sound familiar to anyone ???