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).
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!