How to retrieve values from a DME Call
In the following Javascript function I am writing the DME Call selects 2 fields from the HRHISTORY table. I need some assistance with what programming is needed to retrieve, reference the return records/field values from the DME query.
Also should the DME call output be in CVS or XML format?
function myDMECall() { var vCompany = lawForm.getDataValue("text1"); var vEmployee = lawForm.getDataValue("text2"); var vAdjHireDate = lawForm.getDataValue("text14"); alert(vCompany + ", " + vEmployee + ", " +vAdjHireDate); // DME Call var s = portalWnd.DMEPath; s += "?PROD="+strPDL; s += "&FILE=HRHISTORY"; s += "&FIELD=BEG%2DDATE;A%2DVALUE"; s += "&SELECT=COMPANY=" + vCompany + "%26EMPLOYEE=" + vEmployee + "%26FLD%2DNBR=20" + "%26BEG%2DDATE%3E%3D" + vAdjHireDate; s += "&OUT=CSV&DELIM=~&NOHEADER&MAX=2"; alert(s); var sReturn=portalWnd.httpRequest(s);
.... }
Hi David,
Thanks for the code snip.
For some reason the For loop is not making sense to me. A few questions...
What is the test condition for the loop (i=0,i &hellip ?
Shouldn't there be an increase value for the loop ex. (i++) ?
I am assuming that the "comp=vCols[0].firstChild.data" should be "comp=vCols.firstChild.data" so that the loop index is referenced. Is my assumption correct?
When is the l variable used?
The vCols[0].firstChild.data is correct and it references the first data element in your DME call. 0=first field, 1=second field
Send me an email david@consultdavidw.com and I'll email you my script sample