I created a new HR11 screen to display the Job Class and its description, on the 2nd tab. The first time the program is initialized, these new fields don't get filled out. On any subsequent trans they work fine. Any suggestions?
How are you loading the fields? Are you using JavaScript?
function FORM_OnAfterTransaction(data) { //was transaction successful? if (formState.agsError) return; var vCompany=lawForm.getFormValue("text1"); var vJobCode=lawForm.getDataValue("EMP-JOB-CODE");
// blank out jobclass and desc fields. lawForm.setFormValue("text165",""); lawForm.setFormValue("text166","");
//Find the jobcode record dmeStr = "?XCOLS=TRUE&XKEYS=TRUE&XCOUNT=TRUE" + "&XRELS=FALSE&XIDA=FALSE&XNEXT=FALSE" + "&PROD=" + portalObj.getUserVariable("PRODLINE") + "&FILE=JOBCODE" + "&FIELD=JOB-CLASS" + "&INDEX=JBCSET1" + "&KEY=" + vCompany + "=" + vJobCode + "&OUT=XML";
var vDMEInfo = top.httpRequest(top.DMEPath + dmeStr);
//Set the DME result data to an XML object to parse through. var DMEobj = new top.DataStorage(vDMEInfo); var vRecords = DMEobj.document.getElementsByTagName("RECORD"); if (vRecords.length == 0) { alert("No JOBCODE record found."); return true; } else { // alert("JOBCODE record found."); var vCols = vRecords[0].getElementsByTagName("COL"); //get jobclass from XML object. vJobCls = vCols[0].firstChild.data; lawForm.setFormValue("text165",vJobCls); }
//Find the jobclass record dmeStr = "?XCOLS=TRUE&XKEYS=TRUE&XCOUNT=TRUE" + "&XRELS=FALSE&XIDA=FALSE&XNEXT=FALSE" + "&PROD=" + portalObj.getUserVariable("PRODLINE") + "&FILE=JOBCLASS" + "&FIELD=DESCRIPTION" + "&INDEX=JCLSET1" + "&KEY=" + vCompany + "=" + vJobCls + "&OUT=XML";
//Set the DME result data to an XML object to parse through. var DMEobj = new top.DataStorage(vDMEInfo); var vRecords = DMEobj.document.getElementsByTagName("RECORD");
if (vRecords.length == 0) { alert("No JOBCODE record found."); return true; } else { // alert("JOBCLASS record found."); var vCols = vRecords[0].getElementsByTagName("COL"); //get jobclass from XML object. vJobClsDesc = vCols[0].firstChild.data; lawForm.setFormValue("text166",vJobClsDesc); return true; } }
I'll try that but I do know that both values load correctly, I displayed the results during my testing to be sure! Company is of course a required field, so I didn't have to rely on the resulting load of data, the user must enter it.
Thanks John, that worked.
I also added another lawForm.setActiveTab('TF0-0'); statement, near the bottom, to make the Main tab be the one that appears first.
Thanks for your help! Mark.
Any other ideas here? The users were not happy when the main tab is always the one they see no matter which tab they started on.
TIA!