Help accessing data returned by a DME call

Sort:
You are not authorized to post a reply.
Author
Messages
Shelby
Basic Member
Posts: 10
Basic Member

    I am new to HTML/Javascript coding in Lawson S3. I have been asked to replace the use of cycles.htm with a BS06 AGS call in the benefit enrollment (ESS) calculations for mid-year new hires. However, I think a DME call to the BNCYCDTL table will be easier since I only need to retrieve the number of cycles remaining (and not do any type of updating). I can run my DME query in Excel Add-ins and get the one record that I need. But when I try to add the DME code in elect_ben_06.htm I cannot find the information returned.

     

    Here is my DME code for my test record (FRAME1 is defined as an iframe):

    var dmeObj    = new DMEObject(parent.parent.prodline,"BNCYCDTL");

    dmeObj.out    = "JAVASCRIPT";

    dmeObj.index  = "BCCSET1";

    dmeObj.max    = "600";

    dmeObj.otmmax = "1";

    dmeObj.field  = "company;cycle-begin-dt;cycle-end-date;cycle-freq;cycle-plan;effect-date;remain-cycles"

    dmeObj.key    = "800" + "=EXPT=" + "20110101" + "=" + "2";

    dmeObj.select = "(cycle_begin_dt<=20111009&cycle_end_date>=20111009)";

    //dmeObj.func = "getcycles()"; // removed to get return info immediately following the call

    dmeObj.debug  = true;

    DME(dmeObj,"FRAME1");

     

     if(self.FRAME1.NbrRecs != 0)

     {

        cycles = self.FRAME1.record[0].remain_cycles

        parent.parent.seaAlert("DME FRAME1 cycles = " + cycles)

     }

     

    I do get the DEBUG window showing the query. But when I try to retrieve the “remain_cycles” value it is “undefined” or “null or not an object”. (I have been using the IE Developer Tools debugger to try different ways to find the data).

     

    Can someone please help me extract the information from the DME call? I have tried to piece together code from various forum posts, but I have not yet  been successful. Any help would be appreciated!!
    Judy Consoli
    Veteran Member
    Posts: 43
    Veteran Member
      Do you have fiddler loaded on your machine - free download www.fiddler2.com???

      Load it and cut the DME call and paste it into your IE address bar and see what the results are. This looks good - could just be your self.FRAME1.record code
      See if you are getting results by pasting results and executing DME directly from IE
      Scott Perrier
      Veteran Member
      Posts: 39
      Veteran Member
        I am having the very same issue seeing my results from my AGS call. Judy, thanks for the suggestion. i will see if that helps.
        Shelby
        Basic Member
        Posts: 10
        Basic Member

          Hi Judy,

          Thank you for the idea. I am not sure I understand how to paste the DME into the URL. But, I am getting the expected results back in Fiddler.

          Here is a portion of the "Raw" output from Fiddler (tags modified to allow for posting, the full output is attached) - I am still unable to figure out the syntax to pull out the remain_cycles value (which is "5" in this example):

          [RECORDS count="1"]
          [RECORD]
          [COLS]
          [COL][800][/COL]
          [COL][10/09/2011][/COL]
          [COL][10/22/2011][/COL]
          [COL][2][/COL]
          [COL][EXPT][/COL]
          [COL][01/01/2011][/COL]
          [COL][5][/COL]
          [/COLS]
          [/RECORD]
          [/RECORDS]

          Any suggestions would be appreciated!

          Attachments
          Shelby
          Basic Member
          Posts: 10
          Basic Member
            I figured out how to make the DME call via the web browser. I pared down the data returned to just the one column that I need (remain_cycles).

            This is the DME call used:
            http://[yourservername]/servlet/Router/Data/Erp?PROD=DEVA&FILE=BNCYCDTL&OUT=XML&INDEX=BCCSET1&FIELD=remain-cycles&KEY=800%3DEXPT%3D20110101%3D2&SELECT=%28cycle_begin_dt%3C%3D20111009%26cycle_end_date%3E%3D20111009%29&MAX=600&OTMMAX=1&XRELS=FALSE&KEYS=FALSE&XIDA=FALSE

            The data returned is what was expected - 5 (see attachment for the full XML result set).

            But, when I added the call to the javascript I received a security violation message. I would like to go back to using the DMEObject call, but I have still been unable to parse the XML using the DOM syntax. Is the "CDATA" tag throwing a monkey wrench in the parsing?

            Any suggestions would be appreciated!
            Attachments
            Judy Consoli
            Veteran Member
            Posts: 43
            Veteran Member

              Can you give me your email address so that I can talk to you directly???

              Judy
              Shelby
              Basic Member
              Posts: 10
              Basic Member
                Hi Judy,

                I have sent a message to your "inbox".

                Thank you!
                You are not authorized to post a reply.