ESS AGS call in JavaScript not returning data

 2 Replies
 0 Subscribed to this topic
 18 Subscribed to this forum
Sort:
Author
Messages
Shelby
Basic Member
Posts: 10
Basic Member
Hi,

I am trying to copy an existing custom AGS call from elect_benefits.htm to elect_ben_05.htm. We are using ZN31.1 to determine if the Evidence of Insurability (EOI) statement should be displayed. 501 indicates the message should be displayed.

In elect_benefits, the returned data is found in self.js1.RtnMsgErrNbr. However, when I step through the code in elect_ben_05, self.js1.RtnMsgErrNbr is undefined. (I can momentarily see the value set as 501 in the Debugging Tool. But when control returns to elect_ben_05, RtnMsgErrNbr is undefined).

I have verified that the same hidden iforms are included. I have verified that the same script files are included. The AGS call is the same in the two files.

What am I missing? Any help or suggestions would be greatly appreciated!

Here is some of the code ("FC=V" is the code for verification):



<script src="/lawson/webappjs/commonHTTP.js"></script><br /> <script src="/lawson/xhrnet/xml/xmlcommon.js"></script><br /> <script src="/lawson/webappjs/transaction.js"></script><br /> <script type="text/javascript" src="/lawson/xhrnet/ui/ui.js"></script><br /> <script src="/lawson/webappjs/javascript/objects/Sizer.js"></script><br />
<script><br />

var showEOI = false
function CallZN31()
{
        var object1 = new AGSObject(parent.parent.prodline, "ZN31.1")
        object1.event="ADD"
        object1.rtn="MESSAGE"
        object1.out="JS"
        object1.debug = false
        object1.longNames=true
        object1.tds=false
        object1.field="FC=V"
                + "&BEN-COMPANY=" + escape(parent.parent.company)
                + "&EMPLOYEE=" + escape(parent.parent.employee)
                + "&BEN-PLAN-TYPE=" + escape(parent.parent.EligPlans[parent.parent.CurrentEligPlan][1],1).toString().replace("+","%2B")
                + "&BEN-PLAN-CODE=" + escape(parent.parent.EligPlans[parent.parent.CurrentEligPlan][2],1).toString().replace("+","%2B")

         object1.field+="&ENROLL-OPTION=O"
         object1.field+="&ENROLLMENT-DATE=" + escape(parent.parent.BenefitRules[2])
         object1.func="parent.ShowEOI()"
        AGS(object1,"js1")
}

function ShowEOI()
{
   // NOTE - This function is not being called by AGS
   //if (self.js1.RtnMsgErrNbr == "501")
   if (self.document.getElementById("js1").RtnMsgErrNbr == "501")
   {
        showEOI = true
   }
}

function startProgram()
{
        ...

        CallZN31()
        //if (self.js1.RtnMsgErrNbr == "501")
        if(showEOI == true)
        {
            html += '
'
            html += '
'+getSeaPhrase("LTD_EOI1","BEN")
            html += '

'+getSeaPhrase("LTD_EOI2","BEN")
            html += '

If you wish to change your election to waive so as not to have the EOI requirement, please click on "Previous" or "Make Changes" at the end of your election.'
            html += '
'
        }

        ...
}
</script>

<body onload="setLayerSizes();startProgram()" style="visibility:hidden"><br />         
       

     ...




Shelby
Basic Member
Posts: 10
Basic Member
The lines with the iframe information was cut off ...

<body onload="setLayerSizes();startProgram()" style="visibility:hidden"> <br /> <iframe name="js1" src="/lawson/xhrnet/dot.htm" style="visibility:hidden;height:0px;width:0px;"></iframe> <br /> <iframe name="lawheader" src="/lawson/xbnnet/besslawheader.htm" style="visibility:hidden;height:0px;width:0px;"></iframe> <br /> <div> ... </div> <br /> </body> <br />
Shelby
Basic Member
Posts: 10
Basic Member
I have finally been able to resolve the issue - it was timing. Execution of the code would continue before AGS could call the ShowEOI function and set the boolean flag. My workaround has been to create a message DIV then have the ShowEOI function display the message using innerHTML when appropriate.