Javascript DME return value of a user field to personal profile screen

 1 Replies
 0 Subscribed to this topic
 18 Subscribed to this forum
Sort:
Author
Messages
catcher_in_the_rye
New Member
Posts: 1
New Member
I am new to the javascript piece of portal programming and I am trying to add info from hrempusf to the personal profile screen in ESS. I have the right DME call when I post in a URL, but I am getting value of undefined from the debugger when trying to get the value on screen. Below is what I reverse engineered but my value for depPlanFields is erroring out undefined. I'm a newbie, but trying to learn on the fly. Thanks.

function GetBemsID()
{

var DMEstr = "https://lawson9-dev.aviallinc.com/cgi-lawson/dme.exe?prod=dev&file=hrempusf";
DMEstr = DMEstr + "&INDEX=heuset1";
DMEstr = DMEstr + "&KEY=" + authUser.company + "=0=" + authUser.employee;
DMEstr = DMEstr + "&FIELD=a-field";
DMEstr = DMEstr + "&SELECT=field-key = 74";
DMEstr = DMEstr + "&XCOLS=TRUE&XKEYS=TRUE&XRELS=TRUE&XCOUNT=TRUE&XIDA=TRUE&XNEXT=TRUE&OUT=XML";

var depPlanObj = DMECall(DMEstr);

var depPlanFields = depPlanObj.getElementsByTagName("COLS");

alert("BEMSid " + depPlanFields)
alert("depPlanObj" + depPlanObj)
}
////////////////////////////////////////////////////////////////////////////////
/////Addition of Boeing Employee ID
GetBemsID()
if (NonSpace("bemsid") != 0)
{
PersonalContent += '  '+titlefont+'BEMS Number  '
+ '  ' + datafont + depPlanFields + '  '
nextcolor = getNxtClr(nextcolor)
}
/////
Steven Gray
Advanced Member
Posts: 21
Advanced Member
New Poster
New Poster
Congrats on posting!
It looks like you loose the local variable depPlanFields when you return from GetBemsID(). Try defining it globally, or returning it as a string from GetBemsID().