PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 12/2/2020 8:13 PM by  Lynne
Trying to re-purpose some Design Studio Screens to work in Chrome instead of IE. Need some guidance on processing DME calls
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Matt Sherwood
Private
Private
Advanced Member
(60 points)
Advanced Member
Posts:22


Send Message:

--
12/2/2020 6:55 PM

     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
    Application Specialist
    Covenant HealthCare
    Veteran Member
    (304 points)
    Veteran Member
    Posts:122


    Send Message:

    --
    12/2/2020 7:30 PM
    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
    Private
    Private
    Advanced Member
    (60 points)
    Advanced Member
    Posts:22


    Send Message:

    --
    12/2/2020 7:37 PM

    Thank you!  I will check it out.

    Matt Sherwood
    Private
    Private
    Advanced Member
    (60 points)
    Advanced Member
    Posts:22


    Send Message:

    --
    12/2/2020 8:08 PM
    Lynne, That seems to have worked! Thank you so much!
    Lynne
    Application Specialist
    Covenant HealthCare
    Veteran Member
    (304 points)
    Veteran Member
    Posts:122


    Send Message:

    --
    12/2/2020 8:13 PM
    You're welcome. Happy to eliminate a little grief.
    You are not authorized to post a reply.