PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01/03/2014 3:47 PM by  Robert Spurr
Read Logan from CB55
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Jeff Pratte
Mgr. Portal Apps
ULLICO
Basic Member
(25 points)
Basic Member
Posts:13


Send Message:

--
12/30/2013 9:54 AM
    Gang,

    I would like to read a Logan table (WFVARIABLE) from inside of CB55.

    I have a working read of CBPAYMENT:

    function CheckForDup()
    var thisDup = 0;
    var myTransNumber = lawForm.getDataValue("CBM-REFERENCE-NO");
    var s = "http://" + window.location.host + portalWnd.DMEPath;
    s += "?PROD="+portalWnd.oUserProfile.getAttribute("productline");
            s += "&FILE=CBPAYMENT";
            s += "&FIELD=REFERENCE_NO";
            s += "&SELECT=REFERENCE-NO=" + myTransNumber;
            s += "&OUT=CSV&DELIM=~&NOHEADER=TRUE";

            var objhttp = portalWnd.objFactory.createInstance("HTTP")
            objhttp.Open("GET", s, false)
            objhttp.Send("UserInfo")
    cReturn = objhttp.responseTEXT

    if(cReturn > '') {thisDup = 1;}
    return thisDup ;
    }

    Now I am trying to do something similar for WFVARIABLES.

    This is what I have so far:

    function CheckForDupTwo()
    {
    var workUnit = 0;
    var field = 0;
    var seq = 0;
    alert('CheckForDupTwo');
    //function GetMMDistInfo(workUnit,field,seq) { 
    var  logancall = new DMEObject("LOGAN", "WFVARIABLE")
    logancall.out = "JAVASCRIPT"
    logancall.field = "workunit;variable-name;wf-seq-nbr;variable-value"
    logancall.index = "wfvset1"
    logancall.max = "1"
    logancall.xida = true
    logancall.key = workUnit + "=" + field + "=" + seq
    logancall.func = "FinishMMDist()"
    DME(logancall, "jsreturn")
    // you cannot return the results from this function -> return FinishMMDist()
    return thisDup ;
    }

    I know the values for the read are set to zero right now. When I run this is get this error message:
    SCRIPT5009: 'DMEObject' is undefined 

    What do I need to do to fix this?

    Thanks, Jeff

    Robert Spurr
    Private
    Private
    Veteran Member
    (344 points)
    Veteran Member
    Posts:130


    Send Message:

    --
    01/03/2014 3:47 PM
    I know you were probably looking for something constructed in your format but I couldn't make it work so I thought I would supply something that does work. Hope it helps.

    //Specfic values for testing
    var workUnit = "24837";
    var field = "RQH_COMPANY";
    var seq = "1";

    //DME call
    var s = "?PROD=LOGAN";
    s += "&FILE=WFVARIABLE";
    s += "&INDEX=WFVSET1&KEY=" + workUnit + "=" + field + "=" + seq;
    s += "&FIELD=WORKUNIT;VARIABLE-NAME;WF-SEQ-NBR;VARIABLE-VALUE";
    s += "&MAX=1&OUT=XML";

    var sReturn = portalWnd.httpRequest(portalWnd.DMEPath + s);

    if (!sReturn || sReturn.status)
    {
    var msg="Error calling DME ";

    msg += (sReturn
    ? "(status code): " + sReturn.status
    : "bad server response.");
    alert(msg);
    return true;
    }

    var vObjDMEXML = new portalWnd.DataStorage(sReturn);

    var vRecord = vObjDMEXML.document.getElementsByTagName("RECORD");

    if (vRecord.length == 0)
    {
    //enter your error process
    return true;
    }

    vCols = vRecord[0].getElementsByTagName("COL");

    alert(vCols[0].firstChild.data);
    You are not authorized to post a reply.