Trying to re-purpose some Design Studio Screens to work in Chrome instead of IE. Need some guidance on processing DME calls

Sort:
You are not authorized to post a reply.
Author
Messages
Matt Sherwood
Advanced Member
Posts: 22
Advanced Member

     From the Infor Lawson Design Studio User Guide 10.1.x Published March 02 , 2018

    Page 108

    There is a script example for reading the result of a DME call that I believe only works in IE.   We have this code in many of our forms. 

    We are trying to get users to change to Chrome, but for whatever reason the code I'm indicating below does not appear to work in Chrome.  

     

    I am wondering if I can get an example for the Chrome Equivalent


    } // create an XML object to contain the DME data
    var vObjDMEXML = new portalWnd.DataStorage(vDMEInfo);

    // load a variable with the records returned by DME
    var vRecords = vObjDMEXML.document.getElementsByTagName("RECORD";

    if (vRecords.length == 0)
    {
    alert("No assets found matching this tag number.";
    return true;
    }
    var vCols = vRecords[0].getElementsByTagName("COL";
    lawForm.setElementValue("Text1",vCols[0].firstChild.data);
    return true;}

     

    I will of course post right away if I hear anything back from Infor, or if I make any meaningful progress on my own. 

    Lynne
    Veteran Member
    Posts: 122
    Veteran Member
      Hi Matt,
      I just went through this exercise and I believe your issue is the same as mine was. It was the vCols[0].firstChild.data that was causing the problem. Below is my old code that worked in IE but not chrome, followed by the new code that works in both. I can't seem to highlight here to point out exactly what I changed but you can see the change in the second line of code.

      Old Code:
      var vCols = vRecords[0].getElementsByTagName("COL"); // Retrieve the first (and only) returned record
      var vReq = vCols[0].firstChild.data; // Set vReq to first returned data element of DME


      New Code:
      var vCols = vRecords[0].getElementsByTagName("COL"); // Retrieve the first (and only) returned record
      var vReq = new portalWnd.DataStorage(vRecords[0]).getElementCDataValue('COL', 0); // Set vReq to first returned data element of DME

      Matt Sherwood
      Advanced Member
      Posts: 22
      Advanced Member

        Thank you!  I will check it out.

        Matt Sherwood
        Advanced Member
        Posts: 22
        Advanced Member
          Lynne, That seems to have worked! Thank you so much!
          Lynne
          Veteran Member
          Posts: 122
          Veteran Member
            You're welcome. Happy to eliminate a little grief.
            You are not authorized to post a reply.