IC21.2 Reference Verification

Sort:
You are not authorized to post a reply.
Author
Messages
mcl
Advanced Member
Posts: 29
Advanced Member

    I have an application that will create and maintain work orders outside of lawson.  I have created a custom table to hold those work order numbers in Lawson.  I can access the table via Lawson DME, no problem.

    I want users to enter the work order number in the REFERENCE field of IC21.2, and then I will verify against the custom table.  I cannot figure out how to access that field with Design Studio.  When I bring up the fom all the fields at the bottom (detail area) are dim, and clicking any field does not activate its properties.  The OBJECT button at bottom is not active for this form.   What am I missing?

    I can key the work order number in a field at the top of the form (eg User Analysys, whatever that is) and tie it to my verify button and the edit checking is activiated.  I see that the textbox for reference is "text23"  but when I use that for the edit checking I get null string.  HELP!!

    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      Do you have full security access to this form in Lawson? DS only allows you to update based upon your security permissions.
      David Williams
      Gary Davies
      Veteran Member
      Posts: 248
      Veteran Member
        It is because it is an untabbed detail area. Click on Properties on the top right and select detail1 and the object option should appear.
        mcl
        Advanced Member
        Posts: 29
        Advanced Member
          Thanks Gary, I would never have figured that out as method to access the lower portion of the form. However, I still cannot get the following function to understand that I have keyed a value in "text23" which I believe to be the proper textbox for the Reference field. As you can see in the code below, I can grab it from "text9" an upper portion textbox, and the edit check against custom table works fine.

          What am I missing?


          function Verify_WorkOrder()
          {
          var vProd = portalWnd.oUserProfile.getAttribute("productline");

          var SelectWorkOrder = lawForm.getDataValueById("text23");

          // this will work
          //var SelectWorkOrder = lawForm.getDataValueById("text9");

          var vDmeString ="?PROD=" + vProd
          vDmeString +="&FILE=FLEETWO"
          vDmeString +="&FIELD=WONUM;VEHNUM;WOSTS;WODTE;"
          vDmeString +="&SELECT=WONUM^%3D" + SelectWorkOrder;
          vDmeString +="&XCOLS=TRUE"
          vDmeString +="&XKEYS=TRUE"
          vDmeString +="&XRELS=TRUE"
          vDmeString +="&XCOUNT=TRUE"
          vDmeString +="&XIDA=TRUE"
          vDmeString +="&OUT=XML";

          var vDMEInfo = portalWnd.httpRequest(portalWnd.DMEPath + vDmeString)
          var vObjDMEXML = new top.DataStorage(vDMEInfo);
          var vRecords = vObjDMEXML.document.getElementsByTagName("RECORD");
          var numRec=vRecords.length;

          if (numRec ==0)
          {
          alert("WorkOrder: [" +SelectWorkOrder+"] Not Found ");
          }

          if (numRec!=0)
          {
          var vAlert = ""
          for (i=0;i {
          var vCols = vRecords.getElementsByTagName("COL");
          var cWO = vCols[0].firstChild.data;
          var cVEH = vCols[1].firstChild.data;
          var cDTE = vCols[3].firstChild.data;
          vAlert += "PL[" + vProd + "]" + cDTE;
          vAlert += "WO: " + cWO + "\n"
          }
          lawForm.setFormValue("text29",vAlert);

          alert (vAlert)
          }

          return true;
          }
          Terry P
          Veteran Member
          Posts: 234
          Veteran Member
            You want getDataValue not getDataValueById if you're using the fieldname text23
            Terry P
            Veteran Member
            Posts: 234
            Veteran Member
              Ooops, sorry it should be getFormValue
              mcl
              Advanced Member
              Posts: 29
              Advanced Member
                The following code worked. Give credit to a resource at Ciber. "Because you’re in a detail section of the form,, you can have multiple rows on the screen, so you have to tell it what row you’re looking at. IC21.1 is a little different because it only has 1 row on it (which is always row zero)."

                var SelectWorkOrder = lawForm.getDataValueById("text23",0);
                Terry P
                Veteran Member
                Posts: 234
                Veteran Member
                  I'm surprised that getDataValue works. I always thought that was for table fields and you should use getFormValue for form elements.

                  As a side note, you must not be on version 9. I was told in version 9 the row numbers start at 1, not 0 as in previous versions. Can someone confirm that who is on 9? I'm going to start converting my forms in a couple of weeks and was going to change them to reflect that.
                  mcl
                  Advanced Member
                  Posts: 29
                  Advanced Member
                    Terry, we are on Version 9
                    Terry P
                    Veteran Member
                    Posts: 234
                    Veteran Member
                      This is from the Design Studio 9.0 Release Notes:

                      Description The Transaction servlet (formerly AGS) has been completely rewritten for
                      release 9.0 and handles detail lines differently in some situations. As a result,
                      numbering of detail lines in Design Studio now starts at 0, not 1, as in
                      previous versions of Design Studio.
                      mcl
                      Advanced Member
                      Posts: 29
                      Advanced Member
                        Version 9.0.1.2.89 is the version that shows up when I click HELP About Design Studio.
                        I used the code I entered above and it accessed the work order entry I made in the Reference field. Hope that helps. I was just glad to see it work
                        Terry P
                        Veteran Member
                        Posts: 234
                        Veteran Member
                          Dunno. Guess I'll have to wait and test it on some of my programs when I convert. Glad it works for you though.
                          mcl
                          Advanced Member
                          Posts: 29
                          Advanced Member
                            I tried the following code. It did not work.

                            var SelectWorkOrder = lawForm.getDataValueById("text23",1);
                            You are not authorized to post a reply.